Android app installed is double the size of the apk - android

I upgraded my Eclipse ADT tools to r20 (from r17 or so) and now the applications installed on the devices use twice the size of the apk. The app itself is running fine.
This happens for both the release and the debug versions, and whether I generate the apk with ant (and install thru usb) or launch the app from eclipse.
I tried with various target versions but it's always the same thing.
For info
- I do not use "copy protection" nor licensing, this is direct install, not thru the play store.
- I use proguard to optimize/obfuscate my code. I uncompresed/analyzed my apk and everything seems normal (compared to previous apk that do not exhibit this issue).
Thanks in advance for any info on that.

Installed app's size is always larger than apk. becoz apk is just a zipped file(copressed file) and installed app is unzipped(uncompressed).

Found out the issue.
At the same time as the sdk update, the manifest had been updated, and the preferred storage option (external) had been deleted, So it was installed entirely on the phone memory. and the memory reported in the app manager was double the apk size.
Now it is installed on the SD card, and it uses almost the apk size in system memory as before.

Related

Android Studio generating old version APK

I looked at other solutions for the above problem, but none of them seem to resolve my issue.
I am running AS 3.5.2, under Help/About/Check for new versions everything is showing as fully updated.
I am using Windows. When I plug my phone into my computer, it runs the latest updated version.
When I Build APK(s) under Build menu, and then install that version onto my phone, it is an old version.
Up until about 2 weeks ago it was building APKs fine, and today after making a few code changes (been 2 weeks about since I last made changes), it now has this issue.
What I've tried:
1. build.grade (app) - changed the version code and name to 2 from 1
2. Build menu - clean & rebuild project
3. Checked for updates and updated as needed
4. Run/Debug configurations - confirmed Gradle-aware Make is present (even removed then re-added)
So to add some more information. It turns out the Android Studio IS making the correct version. However, my phone just isn't loading it from the APK. This is what I have done:
I created a new version, 1.07, and with my phone plugged into my computer, it correctly runs this version on my phone, even when I unplug the phone and restart the newly installed app on the phone. I then navigated to the APK stored on our intranet (previously saved there as described earlier in this post), downloaded it and installed it on my phone. It has now reverted to v1.06 strangely. So on a different phone that had an older v1.04, I also downloaded the app from the intranet and installed it, and it showed v1.07. This shows that the APK WAS indeed correctly created. Then on a 3rd phone where the app was never previously installed, I installed it from the app, and it was v1.07. Again, correct version.
I then went to my 1st phone again, went into settings, went to the apps, and deleted the cache and data, then uninstalled it from my phone. I then went to downloads and APK's and deleted all previously downloads. So theoretically no trace should be left on my phone.
I then again downloaded the APK, and it is again v1.06!!!
I plug my phone into the PC (to use as the emulator) and it then correctly installs the correct v1.07 onto my phone.
What is happening...!!!? It is almost like it reverts to the previous v1.06 when I do a manually download and install of a v1.07 APK, but where is the v1.06 even coming from? Does the phone keep a history of the app versions?
Please help me make sense, and how to get it working. This app is for about 300 people in our company, hence me distributing the app over the intranet as a link.
Although this method is a bit vague and old fashioned, but it still works.
Step One: Run your android device as a virtual emulator.
Step Two: Run main.dart in your android device. This will install the app in your device.
Step Three: Go to Play Store and install this app called APK Extractor.
Step Four: Extract your APK from the app.
The APKs created through this are smaller and more efficient as compared to the ones created using Android Studio and work pretty well.

Android Studio Install vs. Google Play Install (App Size on Device)

I seem to be having a problem with limiting the size of my installed Android Application. During development I used Android Studio to deploy my application to my testing device. The app took a total of 2.32 MB in storage when freshly installed.
The problem in size came up when I published my application to the Google Play Store for alpha testing. I uninstalled the same app I had loaded with Android Studio, then downloaded the one I listed on the Google Play Store. The funny thing is that the same app now takes up 4.11 MB in storage.
How did this occur? The testing environment is the same, therefore what additional libraries or information would need to be added to the app causing it to take up the extra 1.79 MB?
TL;DR
App installed on testing device via Android Studio: 2.32 MB in storage
Same app installed on the same testing device through the Google Play Store: 4.11 MB in storage
Why is there such a significant increase in the size of my application? No other variables aside from installation source have changed.
That's because compiling & installing app into one target device and all devices is different.
When you click the run button, you are targeting only single device.
When deploying a signed release apk, you are targeting all screen densities, intel and arm processors. It includes extra files. It makes your apk file bigger.
Check out this existing answer on SO. Android release apk bigger than debug
The answers point out how a debug version only includes resources for the connected devices screen density. For production all images/res are included. Also, you should be able to further reduce size of your apk by using pro guard if you aren't already.

How to install Eclipse generated apk file on real android device

I've developed a simple Android project on Eclipse. Then I export the application as unsigned application onto my PC. Then I copied the application on to the SD card. Then I tried to install the apk file by clicking on it. I also made ensure that I can install applications from sources other than from market. But my application while installing says that application not installed. I've tried one solutions in stack overflow which suggests to install AppInstaller and try from there. Even though it's not working.
What can be the problem with the installation?
Any ideas ?
You need to sign the app, because Android will refuse to install unsigned apps. The debug certificate will also work, but better create one even if you don't intend to release to Play Store, etc. In case you do decide to publish later, make sure you create a certificate with the required validity (more than 25 years), check the guide for details.
After run a successful build ( Project -> Clean or Project -> Build All do the trick) go in your bin folder(automatically generated every time you build) and you will have an .apk file. Browse to that file in your Windows explorer (or whatever you use) and keep that folder. I eclipse show the ddms perspective (Window -> open perspective -> other -> android/ddms) pick the file explorer, drag your apk file over there, and run it on the phone!
You might be installing the app on the device which have lower OS version than the app supported version
Check android:minSdkVersion in you AndroidManifest.xml
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8" />
And your device OS version

How to upgrade the Market Application from version 1.82?

The README for the market billing sample states:
In-app billing requires version 2.3.0 of the Android Market
application. To run the sample application you must have this version
(or a newer version) installed on your device. You can check the
version of the Android Market application by doing the following:
Open Settings on your device and touch Applications.
In Application Settings, touch Manage applications.
Touch All to list all applications.
Scroll down and touch the Market application.
The version number appears under Market at the top of the screen.
Well, I did just that and discovered that my Market version is very old: 1.82
I thought it would update itself automatically (as described here), but for some strange reason it never did, and I can't find a way to do this manually.
I suspect this has to do with the fact that My Android 2.2.1 is a CyanogenMod-6.1.0-N1.
Any idea how to update the Market application in my phone?
Update: I just discovered this thread, which allows me to report success in upgrading to version 2.2.7. Here is what I did:
Downloaded the Vending-2.2.7-signed-testkeys.update.zip file
Copied the Vending.apk inside it to the sdcard
Downloaded ZipSigner 2 (from the Market)
Selected the new Vending.apk as input, and specified signed-vending.apk as output.
Selected "platform" as key/mode
Signed the file (success).
Ran the resulting signed-vending.apk from File Manager.
Wow! That is some progress. I believe the way from here to 2.3.0 would be easier.
I have been able to upgrade to the latest 3.4.4, thanks to the first reference in Wikipedia. Here is what I did:
1. Downloaded the "Android Market 3.4.4 With Noticeable Speed Improvements" file.
2. Copied the downloaded AndroidMarket_v3.4.4.apk to the sdcard
3. Downloaded ZipSigner 2 (from the Market)
4. Selected the new Vending.apk as input, and specified signed-v3.4.4.apk as output.
5. Selected "platform" as key/mode
6. Signed the file (success).
7. Checked "Allow installation of non-Market applications".
8. Ran the resulting signed-v3.4.4.apk via File Manager.
Works like a charm!
One more solution could be, go to menu, select "update over wifi only". Whenever you come under wifi range, if there are any updates, it will give you a notification. With this you can always have the latest version of the market app since even market app is an apk file :)

Android - Issue with .apk file

I do understand that a .apk file is created in the bin folder of an android project, when the project is run.
I have a question about this: is it possible that there would be any difference in the functionality of an app installed via eclipse (as in connecting the phone to the computer and uploading and installing the app on the phone) versus installing the app by downloading a .apk placed on a secure server?
The reason I ask this question is that I usually put up the .apk file on a secure server and the testing team downloads and installs the app for testing purposes. The testing team has started to report app crashes when accessing this app. However, I don't seem to be seeing the any such problems (even while replicating the same scenarios) with the app when I install it on the phone via a cable connected to the computer.
You might be falling into a caching issue. Make sure you get the QA team a new filename of the apk on the server to ensure that they never get a cached apk when downloading it. Also maybe create a md5 sum of the apk locally and run md5 on the apk on the server after upload to ensure it is the same.
e.g. use
md5 yourapk.apk > yourapk.md5
on your machine and the server..
Most likely you QA team has found issues that are specific to the device or Android platform version they test with. Try with your apk with the same hardware in your dev environment.
I don't see how that would possible. The Eclipse ADT plugin just calls the executables in the specified Android SDK location on your hard drive and the .apk gets generated only once when you use Eclipse to install the application to your plugged phone.
Unless you're packaging the two versions in a different way, that shouldn't be possible. My guess is that your testing team has just found bugs specific to the runtime environment (the phone). Maybe a different version of Android, conflicting custom ROM, etc.
No, there is no difference , if the apk on the secure server is as latest as you have on your computer.
I would recommend you to clean your project before uploading the apk to the server.
Regarding the crashes, i guess there are some location based problems.
Also check if you are uploading the apk from your workspace. or some other older version which is located in different place that you are not using anymore.

Categories

Resources