android - using the new android expansion for large applications - android

until recently , for too large apps (50+ MB apps) you had to use your own server to host the large files and add your own logic on the app to download and handle the file from the server.
on March 5th 2012 , google published of a new way to host your large files (via the android market , which is now called "android play" ) , so apps can reach up to 4GB of size:
http://android-developers.blogspot.com/2012/03/android-apps-break-50mb-barrier.html
it has its limitations and rules , but it's free and i think everyone should consider using it.
my question is : is there any nice tutorial , including sample project , that i can do the minimal changes in order to make it work with my app ? maybe someone has already tested it and would be able to share a sample project?
i've tried to read what they wrote there , and it seems that for every thing i read , there is another link to read from , and in the end i didn't understand the full step-by-step process that i need to go over in order to create a working project.

It's not exactly a tutorial, in that it doesn't give you line-by-line code to create a complete application, but the Developers Guide article on APK Expansion Files contains a quite detailed checklist of things to do.

there's a nice sample project that comes with the library when you download it - saved me a lot of work.

Related

How to achieve Dynamic code Loading in Android?

Objective:
I have an android application (main) from which I want to download (jar, apk, or any sort of package) and load the package dynamically and start the main activity of my loaded package from my main application.
The solutions I have tried:
I have followed this blog post and try to load the app using DexClassLoader https://medium.com/#kalpeshchandora12/dynamic-code-loading-in-android-dea83ba3bc85#:~:text=DCL(Dynamic%20code%20loading)%20allows,location%20and%20executed%20at%20runtime. I am able to follow all the step and able to load the class from the downloaded apk, now I don't know how to call the main activity of the loaded apk.
I have followed this plugin(https://github.com/DroidPluginTeam/DroidPlugin), which is telling me that I can dynamically load the apk from the server, and then I can install it in the background and then can run it by any communication method (broadcasting, AIDL, etc.) but while following the plugin, I have encountered an error (sort of I/O error while opening APK), it's not able to open my apk for installation.
I don't know if whatever I tried is correct or not and I am not an android guy, instead, I am a unity guy and trying to run my games (I have almost 50) within android applications. There is no choice of loading the game statically in the android project because it severely increases the size.
Please recommend me an approach to achieve this task or if anyone can guide me on how to solve the problems that I am facing.
It sounds like you need look at Feature Delivery.

Codeanywhere: backup on Android

I'm trying to use codeanywhere's app to do some coding on my android phone while on the road. It works fine except I'd like to make backups of my files and can't figure out a way. My attempts:
Download files and folders from the app. There is an option to do this in a ... menu but it doesn't work; it takes me to a blank page where nothing happens
Through scp. This is only possible using an ssh key, and I couldn't find an easy to use android app for scp with keys instead of password.
By connecting to github. After reading this I decided to create a new github account for this purpose. However I can't figure out how to set up a new repository on android. Also this seems a bit elaborate just to take backups of a toy project..
Any ideas? Or suggestions for other ways to do on the road coding (I'm writing in Haskell)?
In case anyone has the same problem: downloading files / folders works from the website (not the app)

Download File From DropBox - Android

I am trying to write an app in Android that when requested will download a specific file from DropBox if the file is available.
I have gone through all of the tutorials in the developer section on the DropBox site but I don't think they are really detailed enough as each of the tutorials seem to have bits missing and I haven't been able to get any of them to fully work.
I have tried examples of both uploading/downloading files from the tutorials but each time I get to this part of my code I get Exception errors. This leads me to believe that I have missed something out so I was wondering whether there was a decent tutorial anywhere that properly explains the process of downloading a specific file (rather than bringing up DropBox for the user to select the file) from dropBox so that I can follow it through and hopefully will help me to understand where I am currently going wrong.
I know there are lots of questions similar to this but most of them state that they can get part of the process to work and need help on a particular part but I don't seem to be able to get anything to work other than the actual linking to my DropBox account (I have created a DropBox app and have added the keys etc. to my software).
If anyone can help point me in the direction of a decent tutorial that properly explains this process I would be grateful.
Thanks...
I thought I should expand on my issue which hopefully will help to identify the problem that I am having.
The main tutorial I am using at the moment is: https://www.dropbox.com/developers/core/start/android
I have created an app in the App Console which allows file sharing; this has also given my key and secret code.
I have downloaded and installed the mentioned SDK and have added it to my project; I know this works as without the SDK installed most of the code produces errors.
I have added the beginning part of this tutorial which sets up the authorization to DropBox from my app; this works as when I test it I am taken to a page on my device that requests that I select the correct DropBox account. Up to this part I have no issues with and it all seems to work.
The next part of the tutorial mentions uploading/downloading files and reading the directory structure. I have tested all of these separately but for each one I get an Exception error; the errors seem to mention something called "json" and a class not being found. The tutorial does not mention needing to install another SDK or any other library files so I am unsure whether it is assuming that something has already been done which I have not known about so hasn't been done.
I hope this makes sense and would appreciate any help you can give me...
It looks like the error is related with JSON library you used to connect with Dropbox server. here is the libraries list I used for my application, it works well and can download the file to cache.
dropbox-android-sdk-1.6.1.jar
dropbox-core-sdk-1.7.7.jar
jackson-annotations-2.2.3.jar
jackson-core-2.2.4.jar
jackson-databind-2.2.4.jar
The library jars in the dropbox-java-sdk-1.7.7 package are not enough.

"Package file is invalid", solution from the developer side (Android)

I'm tired to see a lot of Stackoverflow questions about this, even in Google forums or Google official support site, publishing "solutions" that lead to uninstall package through ADB, to do something with the phone rooted, to delete cache of Google Play Services, etc ...
https://code.google.com/p/android/issues/detail?id=64514
https://support.google.com/googleplay/answer/3300875?hl=en
http://gizmostorm.com/how-to-fix-package-file-is-invalid-error-on-google-play-store/
https://www.google.com/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&q=android%20upgrade%20download%20invalid%20package ...
etc ...
Is there any solution from the package side ?
I mean, I have an app with hundreds of thousands of installs, and unfortunately many users are complaining about this error when upgrading from store my new version.
Obviously, I can not go one by one telling they have to do this or that, because they are not developers, they just want to upgrade and run an app !
Some users are telling me (complaining) this happened since the last "upgrade attempt" of my app, and they are not experiencing this "package file is invalid" with any other app in their phones.
So, I guess it's something I can fix with another upgrade.
Is there ANY SOLUTION that I can do in the next APK compilation, uploading to Google Play Store and fix this without "bothering" my users ?
Thank you in advance
I have also faced same issue in my project as well. I was adding many more features with new jar, git open source library code for Nice UI.
For searching for solution I found play store has issue in one of its updates
http://www.androidcentral.com/google-investigating-package-file-invalid-errors-google-play
But this is totally not relevant to my problem
Again searching I found this
http://birbit.com/how-to-solve-linearalloc-problem/
So the solution looks to be loading a few jar files dynamically using DexClassLoader.
http://android-developers.blogspot.in/2011/07/custom-class-loading-in-dalvik.html
Prepare Interface of the jar file (list of all classes and methods) and have the interface in the app - Need to see how to do this. - We can just have those classes which we need in our app and ignore the rest of the classes. This way we can implement for few existing jars and any new jars that we have to add to make sure we don’t run into this issue again.
Keep the jar in assets folder
Load every class from the jar (based on the list of jars we have in the interface). (The classes will be loaded just once on first launch)
But Based on this, this looks to be involving lot of coding changes and a time consuming things.
Moreover I found that facebook also faced same issue in their initial android app
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
Final Approach I took was removing additional code from jar/git library project which is not require for my application. after that my app got install on 2.3.X with no error.

is there any automated refactoring tool that produces a unique android application?

I have a project template , when i want to produce a unique application manually to update it to the market. I will follow these steps :
Right click in the package name
Refactor, then Rename
Renaming the package in minifest then update the version code
finally to clean the code from imports errors such as *.R; errors
My question is there any tool that automate this refactoring process without being involved on it ?
i tried to create a java tool but it consumes memory and some things i have to finalize it manually , i'm searching for this since 3 days and nothings gives you a clear answer.
My question is there any tool that automate this refactoring process without being involved on it ?
The new Gradle-based build system can handle this scenario. In fact, it allows you to separate the package name used by R.java (to keep it consistent) and the package name used for determining whether the app is unique on the device and in the Play Store.
I recommend that you watch "The New Android SDK Build System" video from the Google I|O 2013 conference to learn more about what it can do, as Xav definitely covers this scenario.
Note that while it is not a "right click", it should make scripting a solution fairly easy.
Thank you all, I've solved this problem by converting the template project into JAR and let another small project handle every thing , I've created a small method that updates the minifest in that small project and i had to update package,ver name and ver code ONLY ,then I've generated the APK using ANT ,however i tested the project and it works fine , hope this will help another people

Categories

Resources