-3

I am developing an Android App (or thought I was) that includes plant descriptions and photographs for 1,200 plants. This data caused the App to be around 250 Meg. When I got to releasing the App I discovered that the App had to be broken into two parts: the main program and most of the data. Breaking up the program took about a week and it was annoying to write my own file system, but that's the way it goes. (And as far as I can tell, Google's program to let Zip files work with URI's doesn't work with Webview.)

Then I tackled the problem of putting a downloader into my program to read the data from Google-Play. The instructions for doing this made no sense. After working on this for a day I finally read the Wikipedia article about Android where it explained that Android development had recently switched from an Eclipse development system to Android Studio. The instructions were for the Eclipse development system. There are no instructions for Android Studio.

The first task in getting the Download software to run is to link to the library in the Extras package. My conclusion after working on this for a couple days was that not only was there no instructions on how to do this but that it can not be done. Linking to a library appears to be done in Android Studio in the File->Project Structure->Dependencies pop-up (although I was never able to discover any useful documentation on linking to a library with Android Studio). In this pop-up there are three ways of adding a "Dependencies" under the "+" symbol. After hours of dinking around I have concluded that you can't link to the Extras packages.

I searched the user/AppData/Local/sdk/extras/google/play_licensing and play_apk_expansion directory systems for a .jar file (not knowing what .jar is but sensing it might be useful) but did not find any. Rather than give up at this point (the logical thing to do) I moved all of the play_licensing and play_apk_expansion programs, subroutines and associated stuff into my App. After a day of changing include statements I was able to get everything to compile.

It was not exactly clear to me how to link all of this stuff into my program but I made a guess that things should work if I made Google's SampleDownloaderActivity my start-up program and just added my simple start-up stuff to their sample program. The App now ran on my development system.

To test it with Google-Play I payed my $25 and filled out lots of paper work and eventually was able to upload my App. When it ran it crashed. A day later I realized that I had not uploaded my .obb file. There does not appear to be any way to upload a .obb file without also uploading the App and you can't upload an App without rolling the version number. Just a note, here, on rolling the version number. The version number that is an integer must stay an integer. If you make it something like 1.0001 the development system crashes somewhere without giving you a reasonable diagnostic message. And if you are using the Development Studio the version number is not in the "manifests" as the documentation states but in the "build.gradle (Module:app)" file. Right after uploading a new App you upload your .obb file, which (I think) must have the same version number as the App. So get the version number of your App put into every place in your program that you reference your .obb file.

Having uploaded my App and .obb file with the proper version numbers everywhere I find that my App runs from the development system but always crashes when it is downloaded from Google-Play. It may be necessary to remove your development version before downloading. One time, and I have no idea why, Google-Play downloaded both the App and the .obb file. It still crashed. The message is always "I'm sorry, your program stopped. OK?" It seems to crash in Google's library programs.

At this point I am at a loss on how to debug Google's software. The fault is obviously mine. Yet, it would be nice to get a message that tells me what I have done wrong. Google Play seems to have given up on downloading my App but that might be because I need to keep uploading new versions and waiting a day before they will download to my Nexus5.

My conclusion, after spending a couple months on developing this App, is that I am throwing in the towel. It makes no sense to me to be developing downloading programs and file systems to manage data when what I want to do is develop an App. Furthermore, Google's policy of having great gobs of Apps that contain buggy downloading software is stupid. Hopefully, someone at Google will get their Google-Play store so that it can reliably download the Apps that people write.

Perhaps someone can quickly see what I have done wrong (other than the obvious, which is to have wasted my time making an Android App). Suggestions on how to proceed with debugging this mess would also be helpful. Sorry for showing that I am a bit unhappy.

  • 5
    uhm...is there a tl;dr version? – codeMagic May 13 '15 at 00:00
  • Would you mind cutting your question down to just the main points? That's a lot to go through. – alannichols May 13 '15 at 00:04
  • My suggestion to you is to just compress your data down to under the 50Mb apk limit so that you don't have to worry about downloading an extension pack, it's too much complexity and hassle if this is your first Android project. Halving the resolution of all your pictures in x and y should reduce the size by 75% Then crank up the JPEG compression for that extra 5% and you have reduced the size from 250 Mb to 50. As a bonus, your users will appreciate you using less of their file space. – samgak May 13 '15 at 02:17

2 Answers2

1

Applications that are more than 50Meg in size currently fail to download from the Google-Play store if you use the latest Android software (Lollipop). One symptom of this failure is the message

"IllegalArgumentException: Service Intent must be explicit"

near the top of the dump when your App crashes.

You can fix this problem by locating the Intent code in licensing/util/LicenseChecker at about line 159. Change that code to this:

     Intent serviceIntent = new Intent(
     new String(Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")));
     serviceIntent.setPackage("com.android.vending");

     boolean bindResult = mContext
             .bindService(
               serviceIntent,
               this, // ServiceConnection.
               Context.BIND_AUTO_CREATE);

Information about this change can be found in this web article:
https://code.google.com/p/android-developer-preview/issues/detail?id=1674

This may not be the only problem. But it is at least one problem.

samgak
  • 23,944
  • 4
  • 60
  • 82
0

THe first thing you did wrong- sticking all that data in your app. It should be downloaded off the web, caching to the filesystem. Its ridiculous and unreasonable to download that much data to all of your users.

The second problem- you don't seem to want to write software. You seem to want to be a designer. You want to hand wave away all the real issues and have your dream magically realized into "an app". You don't seem to realize that all the dirty work is 99% of what every app ever written does.

Third, you seemed to not to have figured out logcat. Whenever you get a "app has stopped" message, the exception that caused it is written to logcat. It tells you exactly what line it crashed on and why. And if you didn't find that you did zero research on the android environment, because its the first thing mentioned in any tutorial on how to debug android.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127