I would like to support multiple dynamic themes for my app. At the same time, I dont want to increase my app bundle size by adding all set of icons and images. I wish, user selectively download from server during runtime.
Following are the two methods I see in stack overflow.
Make the new styles, icons and background images into separate APK and let the user download from google play and import those values during runtime.
How to release application plugin using Android Market?
Make the new styles, icons and background images into a zip file and let the user download and save it in SD card. Write a Resourse manager wrapper to parse and read values from the config file inside the zip file.
Create downloadable custom theme and apply it during run time
Option: 2 looks to be a better solution but it has set of limitations like we can set only the bg color and text color.
Could you please let me know which approach is better? Or is there any other better method.
The first method will be an effective one, Since normal users mostly prefer apps or themes to be downloaded from Play Store.
It will be easy for you also to promote your App as well as your Themes.
You can easily provide new updates for your themes and bug fixes , no need to download a .Zip file again & again.
For our case, we have decided to go ahead with below approach:
For each theme, we will create a config file, that will contain the list of configurable elements (color, icon, image) along with necessary resources (icons, images, bgimage).
We will post this in our server and allow user to browse through the list with a preview image.
If he decides to download a theme, we will download and unpack in local memory.
In our android app, all the elements(textview, imageview, listview) will contain a wrapper which will read from this config and apply before rendering.
NOTE: #4 is too much work, so we will divide all our themes to light and dark in top level. 75% of the config should come from our styles file (light or dark). Only font color, bgcolor, bgimage, iconsets will change based on the config file.
From this approach, we can easily move to the separate apk approach also.
Related
I'm trying to locate the Android XML and drawable files that are used by default for imageButtons.
I'm trying to customise an imageButton using a selector. When I create a new project, by default the background color of an imageButton is transparent-grey and it gets highlighted in blue when touched. (I'm SDK-19 and .Light theme). To avoid the hassles of re-creating lots of icons, I want to find the default XML selector code and 9.pngs Android uses for an imageButton.
Looking in the SDK android-19/data/res/drawable folder there are a bunch of XML selectors defined in files with names like "btn_default_holo_light" "btn_default_transparent" etc., and a bunch of button drawables in .../drawable-hdpi.
I can pick any of these, copy it into a "my_selector.XML" file in my project's drawable folder (plus copy the necessary drawables into my projects drawable_hdpi), and set "my_selector" as my imageButton's background. This all works fine...Except none of the SDK files I've found results in the default "blue when touched" effect (some turn the imageButton orange, others do nothing...).
I'm sure the default files are right there under my nose but I'm pulling my hair out trying to find them!
Any help appreciated
I am afraid you won't find the default images you are looking for in the SDK files. The default images can vary from device to device, rather than from android version to android version. The effect you are looking for is probably specific to your device/emulator.
"The appearance of your button (background image and font) may vary from one device to another, because devices by different manufacturers often have different default styles for input controls."
Reference^^
If you just want to get the images and copy them, you may be able to find them on the actual device by activating USB Debugging and searching through the usually hidden folders on your particular device. The storage of those files probably vary between devices so I am afraid I can't tell you where they are (some files are kept hidden even with Debugging active. In those cases apps such as ES File Explorer might be able to help). Although this probably wasn't the answer you were looking for I hope this helps.
I have a standard aplication. It uses resources - PNGs that are when programming in the DRAWABLE folder. They build up menus, buttons etc etc. ... Classic application nothing special.
And what I need to have is - "theme" support. Lets say I use this PNGs in my app:
menubutton.png
scrollbotton.png
arrwo.png
and these are in the DRAWABLE folder.
And I would like to be able to change the THEME of the app by changing this PNGs for different ones. Lets say I have PNG's with same names, but under a different url:
.../template1/menubutton.png
.../template1/scrollbotton.png
.../template1/arrwo.png
and than I have a another "template"
.../template2/menubutton.png
.../template2/scrollbotton.png
.../template2/arrwo.png
IMPORTANT: Of course all the PNGs have exactly same size, and name
So and the app shall have the functionality to download this PNGs and replace the ones that are currently in use. The important point is that the additonal PNGs from different templates HAVE to be availiable online - I dont want to ship the app with many templates that would not be used.
Can you please confirm this can be done and that it should not be a problem?
The Drawable resources are packaged in to the application and cannot be modified. You idea of using an SD card will work (or you can use the applications sandboxed directory), you just need to manually load the png resources (ex. myImageView.setBackgroundBitmap(...); [pseudo-code]).
As a note: If I ever open an application that immediately tells me to wait since it is downloading resources, I will force-close it and uninstall. Applications on Android, iOS, Windows, etc. should work right away without the need to download more resources. If you want a default "theme" then package it with the app, don't make the user download it (which will cause problems if the user is on mobile networks or doesn't have an internet connection when they open the app)
I want to add a feature on my app to let users give a feedback on data. (for example to report errors or mistakes).
Is there a standard icon for it?
please, visit your android-sdk-* folder, there should be default set of icons and pictures in the ./platforms/android-XX/data/res/drawable-Xdpi/ where "XX" and "X" stand for your android version and screen size. all the standard icons are there.
There are a few system icons whose filenames match 'feedback', but none of them look appropriate to me.
Best I could find is "ic_menu_report_image.png".
I've been using "ic_menu_start_conversation.png".
Whether it’s useful for your app mainly depends on the iconset you’re already using. In a chat-app for example, this icon would be a poor choice :)
Note: this icon is marked as protected. You'll have to copy the images to your source manually.
Because these resources can change between platform versions, you should not reference these icons using the Android platform resource IDs (i.e. menu icons under android.R.drawable). If you want to use any icons or other internal drawable resources, you should store a local copy of those icons or drawables in your application resources, then reference the local copy from your application code. In that way, you can maintain control over the appearance of your icons, even if the system's copy changes.
If you create an activity and set a label without disabling the title bar you will see a title that uses a gradient as a background. Is there a way for me to re-use this resource without re-implementing it?
Thanks
I believe the background for this comes from the resource that is called "activity_title_bar.9.png" that is in the system drawable folder.
Here is a copy of it:
If you download it from here you'll have to rename it using the .9.png suffix. You can also find it in your SDK. The path is "SDK\platforms\android-4\data\res\drawable"
Note android-4 could be any other number that you happen to have installed on your machine.
Generally if you are wanting to use a system resource like this best practice is to save your own copy of it and include it in your project. Resources like this are subject to change at any time with new versions of the OS (or even with device specific skins that Manufacturers add on to the OS) So if you rely on the system copy from inside your app then you have no way to know for sure that it will look the same across all devices.
I've got an Android app that can be themed using a set of images. It lets users select which style of images to use, but in order to keep the main app small and let users download/manage only the additional image sets that they would use I want to offer add-on downloads (like extensions).
What's the best way to do this? Thanks in advance.
Well, Handcent, a mms app that I use, had all their themes on the market. What I guess they did is just keep the file structure the same and when the user downloaded the apk data folder, it was placed into the already existing apk tree of the primary Handcent application. I have no idea if that's how they did it, but I can't see why it wouldn't be feasible.