I'm planning to use the Multiple apk approach to my current project, since it has a big number of drawables for every density and the apk file is big right now. Are there any pitfalls in using this kind of approach? By the way, does the download statistics "sum up" on the Android Market for Multiple apk's? Thanks in advance.
As our comment discussion
In my experience apk size does not affect performance of application.As if you are using hdpi
device then ldpi resource will not load.So device will load only the resource required by
current device.And i think this is best approach.
Second If you want to make three application instead of one for ldpi,hdpi,and mdpi then its very time consuming.and it cannot sum the download of all three application.Android gave three option of ldpi,hdpi,mdpi.So we have to use it.
Hope you got my point
Related
before when I was creating a new project I was found this folders drawable-hdpi,drawable-mdpi, drawable-xhdpi, and drawable-xxhdpi. but now they are all gone!
is there any explanation of what happens?
and where we should put our images?
This is perhaps because they will add an Gradle plugin that converts SVGs to PNGs during build (as mentioned in this IO talk). The idea is that you will only need to have a single SVG instead of multiple PNGs for various densities (an thus, only one drawable folder). You can still create the folders and use PNGs.
The Gradle plugins for SVG conversion by Google has not been released yet, but you can use Victor or a similar plugin if you already want to use SVGs for your drawables.
You should read Android Blog
you can just create drawable-xhdpi.
I just give answer here
read and if any problem ask.
I wasn't aware that Android Studio ever provided these dpi dependent drawable folders for the built-in default project scaffolding, and indeed, why should they?
Are they supposed to guess that you're going to support each and every one of these resolutions? Perhaps all your graphics will be vector graphics? Perhaps you only target low or high resolutions?
Also, the DPI modifier is only 1 of the possible modifiers you can attach to a resource folder. You can also add locale, screen width / height, mobile country code and many more. Should Android Studio create a folder with each of these options, along with every possible variation? You'd end up with thousands of folders which you'd likely never use.
In addition, creating a folder with no assets inside it is a big problem when you start synchronising your code using Github or something similar, and creating every possible folder with default assets inside seems like a huge waste.
I think the best approach here is to create any resource folder you need when you need it. Google leaves this decision to you.
Also, important: There is no XDPI or XXDPI folder - it's XHDPI, and XXHDPI
Check in your project section, Not in android section, If they gone just simply create them
I have one requirement to compress APK size based on type of device(LDPI, MDPI, HDPI.., etc). My client is demanding to give multiple APK's. According to his statement Small devices having low configuration so the apk size should be less, and MDPI is bit better than LDPI so the size may going to increase. So he is demanding to give the build accordingly. So that user will download the app with in less time and saves the internal/ External memory.
For that I tried lot of ways to compress the APK, but I failed at every aspect:
*9- Patch : My project does not contains all the images are 9-Patches, in fact 90% of images are non-9patch's.
*Pro-guard: I tried to reduce the file size using Proguard, but as far as I know proguard is for protecting the my code, and apk size is not much compressed.
* And I tried out not working out for me.
Right now I am following the bellow process, I know this is very bad procedure:
Generating the APK for LDPI devices I kept all resource files in res/ldpi folder only, I am following with same procedure for MDPI, HDPI, XHDPI Etc.,
By using current process, I'm wasting lot of time and it is very bad process also I guess.
To solve the above problem can you please help me out.
Use Gradle for Android and its support for APK density splits. Gradle for Android can then generate APK files for each density, plus an optional "fat APK" containing all densities. You can either use Android Studio as your IDE, or set up a build.gradle file that can build an existing project in the Eclipse/Ant classic directory structure.
However, your client needs to understand that not all distribution channels support distributing different APK files by screen density. The Play Store does. I do not know about other channels (e.g., Amazon AppStore for Android). And the user probably has no idea what the density of their device is, so relying upon the user to choose one of several versions to download from a Web site is unlikely to be reliable.
Inform your client that for all devices apk size will remain same. Make him/her understand that On play store you do not upload different apk's for different types of devices.
I have android application (single apk file) with code and ga lot of graphics, It takes a lot of space. I want to devide my huge application into two parts. The first is a source code and minor graphice (takes low space), the second part includes all other graphic. When user launches first application, it uses graphic from another application.
1) Is solution it possible?
2) If it is possible, how can I access from first apk to a resource file at SD card, whick stores in another zip/archive/jar/or apk?
Maybe you can provide your graphic as a Content Provider in one application and then read them in another application.
You can use Library Projects to achieve this.
There are a number of ways to do this. One of the more popular is to require the application to download the large graphics on "first-run". This is done by most large game apps.
I'm trying to accomplish whats written HERE on supporting multiple screen sizes, I understood that every design in the app should be in 3 sizes.
1. The designer asked the 3 sizes he should design for, he already created designs in 1 size which is 480x800.. What are the other 2?
2. My .apk file is 5 mb big with only the designs of 1 size (480x800).. So when I add the 2 other the .apk will become huge.. How do I avoid this?
Obviously you need to compress the files to a suitable size and implement the look and feel in code/xml.
Besides that if you still run out of room you could create multiple application for different devices with a whole bunch of disadvantages in terms of market presence.
Hi i have develop a application in android which run in every device, i use different layout for different size device's but i have use some code programmatically without xml so, it create a problem in different size device.
so i require to change the package acording to the device resolution so, it can posible in android to programmatically detect and change the package class
plz, give some suggestion.
Thanking you.
i have use android2.2 for my application
No, it is not possible to programmatically change the application package. For device-specific display sizes you can create size-specific layouts as described in the guide and use getResources().getConfiguration() to programmatically choose specific code paths to execute.
"i use different layout for different size device's " means you just use dp/dip sizes or that you have completely different layouts for each screen size?
If you only used dp/dip units, then you can add a scalefactor to your code to get the matching coordinates. If you are using different layouts, it's much more difficult. Depending on how many different layout configurations you have, you could build seperate apk files and upload them parallel. The Market will handle the distribution of the matching files then.
Another way:
Create an installer app which checks the device configuration and downloads the device-specific package afterwards from a ftp/network resource.
After installation, delete the installer and the .apk file.