Stories
Slash Boxes
Comments

SoylentNews is people

posted by n1 on Monday November 09 2015, @01:56AM   Printer-friendly
from the acts-of-digital-gods dept.

Back in 2012, during the early days of KeepSafe, we sought to implement an encryption scheme for our Android App. Through many iterations and prototypes, we found a sweet spot of sorts by leveraging the power of the JNI (Java Native Interface.) We decided to write our interface into the encryption library we utilized in Java, calling into the library via the JNI solely for the purpose of encryption and decryption. We opted for an on-the-fly solution, minimizing the impact on user experience as much as possible. Once we were happy with our solution, we decided to deploy it into our production app. We rigorously tested our code and were confident that everything would go smoothly; that is, until things beyond our control broke.

As we anxiously refreshed our crash reports following our release, we started to notice a recurring error. Users were running into an “UnsatisfiedLinkError”, which means that either A) the native library we were calling into did not exist or B) the native method we were calling did not exist. Since B) would almost always be caught via compiling and basic testing, we were immediately perplexed at the fact that users’ installations did not have the native libraries we shipped within the APK.

That's the agony and ecstasy of software development right there, pal.


Original Submission

This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Insightful) by Anonymous Coward on Monday November 09 2015, @04:36AM

    by Anonymous Coward on Monday November 09 2015, @04:36AM (#260651)

    I'm from a python background and the last time I touched Java was in the 90's, but over the years I've tried to pick up java again a few times with building something for Android. Each time the horror that was Eclipse kept me from it. Last month I checked Android Studio for the first time and for starters it actually runs and doesn't immediately start to complain about missing dependencies and what not like Eclipse used to do. I was actually positiviely suprised. That feeling went away quickly, though.

    Why must starting Android Studio (not the 1st time, but subsequent times) take 10's of seconds on a i7 with 8G of RAM? I know, it isn't the fastest machine but come on, waiting half a minute for an application to start? Wtf. Then the actual building of the app.. My god is that slow. And the amount of completely useless language fluff required for a simple fucking screen with a label is staggering. XML, seriously? I vaguely remember this format should be more readable in some way. A hexdump would be more useful to me than the shit I see in the XML generated by the Hello World project. Really, this could, and very much so SHOULD be, in this time and age, done in a few lines. To me it looks like some kind of ridiculously, way overboard masochistic excercise in doing things as complicated as possible. What a tar pit. I've uninstalled this quickly, I will not touch it again.

    • (Score: 1, Insightful) by Anonymous Coward on Monday November 09 2015, @05:42AM

      by Anonymous Coward on Monday November 09 2015, @05:42AM (#260660)

      I wish Windows phones were popular instead of Android. At least MS has programmers who know a thing or two about programming and backward compatibility and creating an IDE that actually works and code samples that compile and run.

      Android is a failed system that was promoted by a corporation with an agenda. Now that the OS that was supposed to be freedom-loving and faster than anything else (running on GNU/Linux, supposedly) is slow as hell and takes away the user's rights and freedom.

      This is a mobile OS done badly and deserves to die. The IDE is worse than anything I've ever used. Cannot even run on 4GB RAM!!! And don't get me started about Java, the hate-fucked abortion that should have died before it was born.

      • (Score: 2) by frojack on Monday November 09 2015, @07:24AM

        by frojack (1554) Subscriber Badge on Monday November 09 2015, @07:24AM (#260674) Journal

        Android is a failed system

        For some rather unusual values of "failed".

        You might argue that it is a flawed system, but it is far from failed.

        Just because some programmers don't know what they doing doesn't mean the system has failed.
        There is no "do what I meant" instruction.

        --
        No, you are mistaken. I've always had this sig.
        • (Score: 0) by Anonymous Coward on Monday November 09 2015, @09:22AM

          by Anonymous Coward on Monday November 09 2015, @09:22AM (#260708)

          When a programmer declares a project "failed", then it has failed. It does not matter that a marketer for Android calls it the greatest system ever.

          Android isn't a flawed system, it is a flaw.

          Imagine this: If Android did not have the backing of the Google empire, would it still succeed and make a profit? Of course not. If an independent maker had introduced Android, you wouldn't have heard about it and it would have died a silent death.

          Just because some programmers don't know what they doing doesn't mean the system has failed

          That means the platform allowed bad programmers in instead of keeping them out. Which means the system failed to protect its integrity and self-respect.

          • (Score: 3, Insightful) by TheLink on Monday November 09 2015, @11:16AM

            by TheLink (332) on Monday November 09 2015, @11:16AM (#260720) Journal

            When a programmer declares a project "failed", then it has failed.

            That's as stupid as someone saying that when a commenter says a forum has failed then it has failed.

            That means the platform allowed bad programmers in instead of keeping them out. Which means the system failed to protect its integrity and self-respect.

            Huh? If your public platform is popular enough there will always be bad programmers. How would you keep bad programmers out from a popular public platform?

            Just like if a public discussion form gets popular enough there will always be ignorant/stupid/trollish people posting crap.

            So you want a private platform where only people who are "good enough" are allowed to develop for?

            • (Score: 0) by Anonymous Coward on Monday November 09 2015, @01:05PM

              by Anonymous Coward on Monday November 09 2015, @01:05PM (#260741)

              someone saying that when a commenter says a forum has failed then it has failed.

              Technical opinions are impersonal and objective. It hasn't got to do with politics or "my IDE is better than yours" nonsense.

              How would you keep bad programmers out from a popular public platform

              We have to have a minimum level for developers, otherwise Javascript Experts and Gurus will invade the thing and they will be the ones making judgements and setting the future direction of the platform.

              Ever used VB 6? Or worked with VB 6 Gurus?

              • (Score: 1, Insightful) by Anonymous Coward on Tuesday November 10 2015, @09:22AM

                by Anonymous Coward on Tuesday November 10 2015, @09:22AM (#261164)

                I didn't see any technical opinions from the AC proving that "Android isn't a flawed system, it is a flaw." Android is a flawed system like many real world systems in use, but I see zero evidence that it is a failed project whether commercially or technically.

                In your reply you have provided zero viable or plausible methods for keeping out bad programmers from a popular public platform.

                All I've seen so far is worse than:

                "my IDE is better than yours" nonsense.

                Because in some of those there are usually a few decent points and arguments (though most of us have probably heard them more than 100 times). Not that I care so much about those points.

    • (Score: 0) by Anonymous Coward on Monday November 09 2015, @06:16AM

      by Anonymous Coward on Monday November 09 2015, @06:16AM (#260666)

      The XML seems like a lot of overkill until you release that you would have to manually code the layout for well over 40 separate resolutions, while you can make a universal layout XML that covers every single one of those resolutions relatively gracefully, and specific layouts for troublesome aspect ratios or extremely high DPI devices. I am not a fan but the fact that today's devices work with apps that had no idea you can even have a 1440p or 4K screen is pretty impressive.

      • (Score: 2, Insightful) by Anonymous Coward on Monday November 09 2015, @07:44AM

        by Anonymous Coward on Monday November 09 2015, @07:44AM (#260681)

        It's not impressive, it's sad. The fact that a change in DPI could screw up a GUI is a failure that should have never happened in the first place. Anything based on exact pixels is bad design. We should have always been using percentages and the entire GUI should scale instead of stretch.

      • (Score: 5, Funny) by davester666 on Monday November 09 2015, @08:02AM

        by davester666 (155) on Monday November 09 2015, @08:02AM (#260691)

        Yes. The UI is equally poor across a wide variety of resolutions. Kudos to Android for solving this problem.

    • (Score: 0, Insightful) by Anonymous Coward on Monday November 09 2015, @07:38AM

      by Anonymous Coward on Monday November 09 2015, @07:38AM (#260678)

      Why do you expect your IDE to automatically manage all your dependencies for you? Eclipse isn't specifically geared to Android programming so you'll need to manually download everything you need and tell Eclipse where to look. You have to do that for every IDE for every language. Or you can download an IDE pre-configured for whatever task you want, which in this case would be Android Studio which is what you eventually did and discovered it worked. Have you really been a programmer for 15-25 years?

      Someone languages like Python move the dependency managed into package/library managers that ship with the language itself. The package manager works well enough when everything you install happens to require the same versions as everything else, but it basically dumps everything into a folder on your python PATH and you're fucked when it doesn't work. I had to manually download, compile, and install about 19 different libraries just to get the one I wanted working. When the package manager forces you to use SSL in a business environment that breaks SSL, you have to fall back on manual everything (that's a failure of the package manager not the business). Dependencies at the IDE level at least give you a choice of using a different tool to handle them.

      If you're confused about the XML then look at the XML schema or DTD. Or do you prefer undocumented, unstructured formats? You can always use your hex editor to open the XML file..

      • (Score: 1, Interesting) by Anonymous Coward on Monday November 09 2015, @02:04PM

        by Anonymous Coward on Monday November 09 2015, @02:04PM (#260759)

        Why do you expect your IDE to automatically manage all your dependencies for you?

        Well... yes? Shouldn't I expect that a tool designed to automate the software development process... automates the software development process?

        You have to do that for every IDE for every language.

        No you don't.

        The package manager works well enough when everything you install happens to require the same versions as everything else, but it basically dumps everything into a folder on your python PATH and you're fucked when it doesn't work.

        The system-wide environments exists for the purpose of setting up system-wide libraries. I know, I know, +5 insightful remark right here. For development environments, I would use virtualenv [python.org] which conveniently exists to address exactly the problem you are having among other things.

        If you're confused about the XML then look at the XML schema or DTD. Or do you prefer undocumented, unstructured formats?

        *cough*double dichotomy*cough* Sorry, allergies.

        • (Score: 1, Flamebait) by Immerman on Monday November 09 2015, @03:16PM

          by Immerman (3985) on Monday November 09 2015, @03:16PM (#260784)

          No, stock Eclipse is designed for *Java* programming, and Android doesn't run Java, it runs Dalvik. As far as the language and bytecode are concerned it's the same, but Davlik only includes a small subset of the Java standard library, and includes a large selection of alternative libraries.

          Expecting a stock Eclipse install to compile Android apps is like expecting a stock C++ compiler to compile a Ogre3D-based app without having to install the SDK first.

      • (Score: 2) by Pino P on Monday November 09 2015, @03:00PM

        by Pino P (4721) on Monday November 09 2015, @03:00PM (#260777) Journal

        a business environment that breaks SSL

        With the rise of SNI, HSTS, DANE, Perspectives, and other means to make TCP connections tamper-evident, I have three words for anyone in such an environment: Update your resume.

        (that's a failure of the package manager not the business)

        Why is giving an assurance to the user that the packages were not tampered with between the repository and the local machine "a failure of the package manager"? Why is interfering with this assurance not "a failure of [...] the business"?

      • (Score: 2) by Lunix Nutcase on Monday November 09 2015, @03:21PM

        by Lunix Nutcase (3913) on Monday November 09 2015, @03:21PM (#260786)

        Why do you expect your IDE to automatically manage all your dependencies for you?

        Because the point of computers and software are to automate tasks and make the users of said computers and software easier. I'm sorry that some people expect functionality beyond that of 1970s software development tools.

        • (Score: 2) by Lunix Nutcase on Monday November 09 2015, @03:37PM

          by Lunix Nutcase (3913) on Monday November 09 2015, @03:37PM (#260795)

          Make the *lives* of users, that is.

          • (Score: 2) by FakeBeldin on Monday November 09 2015, @10:52PM

            by FakeBeldin (3360) on Monday November 09 2015, @10:52PM (#260967) Journal

            Though I wouldn't be surprised to find out that nerds have become easier since the 70s -- wink wink, nudge nudge, knowwhatimean?

    • (Score: 1) by bram on Monday November 09 2015, @11:57PM

      by bram (3770) on Monday November 09 2015, @11:57PM (#260986)

      I still use ant, and Android.mk Makefiles.
      Blazingly fast.
      Command line builds rule!

  • (Score: 2) by Gravis on Monday November 09 2015, @10:14AM

    by Gravis (4596) on Monday November 09 2015, @10:14AM (#260715)

    this isn't a problem with loading native libraries, this is a problem with java. the solution is to not use java. the android NDK is free, you know.

    • (Score: 1, Offtopic) by Pino P on Monday November 09 2015, @03:05PM

      by Pino P (4721) on Monday November 09 2015, @03:05PM (#260779) Journal

      leveraging the power of the JNI (Java Native Interface.)

      this is a problem with java. the solution is to not use java. the android NDK is free, you know.

      The Android NDK uses JNI. Unless you include binaries for all instruction sets in every APK, using the NDK will cause the problem described in the article of exceptions when trying to run sideloaded binaries made for a different instruction set.

  • (Score: 2) by pgc on Monday November 09 2015, @12:48PM

    by pgc (1600) on Monday November 09 2015, @12:48PM (#260736)

    Apparently they weren't native libraries.