how to update the list of applications in a launcher? - android

I created a launcher to use my tablet with multiple profiles, it is configurable, I can choose the number of users of the tablet, each one will have its own space, with a list of application chosen by the administrator account from a list view which contains all the applications already installed. this list once selected it will be saved in internal storage space. and the existing menu bar will be changed by the addition of new user. and each will have a new profile configuration file internally, my problem is to update in real-time applications, now, the update is only possible if I restart the application, what is the mechanism in android I can used for growing update my launcher without restarting.

I think this answers your question:
How to force an entire layout View refresh?
I also want to point out that you could use less komma's and make smaller sentences. That makes it clearer for the reader.

Related

Is app localization implemented at download time or runtime?

For iOS and Android apps that are designed with regional/language localization, I want to know: Are all of the different localized strings, etc. downloaded onto the user's device when purchasing from the app store, or is it already optimized for file size, by only downloading those that match the user's regional/language settings at the time of purchase?
If it's the former (everything is downloaded onto the device and then the localization is implemented at runtime), then that will be a big problem for me. My app relies on a very large database of text, which needs to be in the user device's language. Having all of the different language versions at the same time will take up a ton of space. So, that means either I have to: 1) have a monster app file size, or 2) have to release a different instance of the app in each language, neither of which is ideal (though I can live with the second option if I have to). Or is there some other way?
Even though I'm still a long way from release I need to start thinking about this because it will affect the way I organize things going forward.
You have to set it in your app, so i don't think that app thining process takes care of that.
If you have a large base of texts you should consider creating a service for it and fetch texts from that service when needed, based on your device language or a user preference (language menu) if you have it in the app.

Only displaying pre-installed applications on android device

So I am using the Home sample to build an application that creates a second home screen for the user. The idea is to be able to have only one user account yet restrict certain access to chosen applications. I have managed to ensure that all of the applications are invisible in the XML yet I am struggling with how to change this to make certain apps visible.
Is it possible to write a whitelist of accepted apps for instance the preinstalled apps or child friendly apps for children who game using the android device and then put in a Java method to access this white list? This is the only way I can think to make it work.
If anyone knows the correct way can you please help.
Thanks.
Ok so I discovered how to do this.
In the home sample they provide a for loop in the Home.java file that covers all apps and displays them. It take a simple if statement to restrict the apps that can be viewed -
// for loop is here
if (info.activityInfo.applicationInfo.packageName.contains("com.android"))
//then the rest of the home sample is here.
Still very basic but provides me with a good enough UI so that kids cannot see apps I don't want them to.

In which way is it possible to update an app?

In which way is it possible to update an app? Except download the hole app thru the market.
To be more specific. Let say I have a app with a main menu with 3 choices
1 Data
2 Tools
3 Settings
For 1-Data...
...gives you a new view with a menu(submenu) which each row give a view that contains normal data as text, pictures (maybey video).
If all data must be stored on the phone to be reach offline.
1.1 How can I update this kind of data? Like change/add some text, photo etc from a server??
1.2 Is it even possible to add new menu rows with new data from a server? Only know about xml menu but these feels so permanent.
For 2-Tools...
...that have a new submenu like before. But here the menu use hardware futures and api:s. Like, uses gps to get a position and show it on a map or make a call or something...
2.1 For this kind of stuff, is it possible just to update a specific changed class that the app could download from a server or something similar?
For 3-settings...
...If you could change the language here.
3.1 Is it possible to update the app from a server with a new language automtic when the translation is ready? Just download the xml:s?
Would be good instead of that you have to noties the user, so the user manually have to download the hole app again (< v2.2).
Im new to this, dont have the hole picture yet.
The common way of doing this (which is accepted by anyone using an Android Device) is simply publishing the new App-version on the Android Market.
Although, it should also be possible to do it like you said but since Apps are not allowed to download runnable code their self (for security proposals) it doesn't madder. Also if you want to improve new functions, you might need more permissions to your Android Manifest (it would be very bad if this file could be edited at runtime...).
If you have an App which works like a client for an Online-Service, it's sure okay to update those contents, but the things you asked for should really be done using the normal App Market.

Can you change your app name (this under icon in list of application) dynamically?

I am wondering which name will be better for my app. I am thinking about experiment, which will change name of application (in 10% downloaded apps). Later I could check statistics which app was used more often.
Is this possible?
No. The app name is specified in your manifest so it will be static. You could change the name in the titlebar of the app though.
Picking a good name is key.
depending on exactly what you want you have a few options. You can call
this.setTitle("New Title Here");
from an Activity and this will change the title that appears at the top of the screen just beneath the notification bar. If you are trying to change the title that appears in the launcher, or on the home screen under the icon I don't think you can do this programmatically. You'd have to create two seperate versions of your application and use the different values for < application android:label> inside your manifest for each of them. Or maybe you could create another values folder like values-hdpi if the values folder works the same as the layout and drawable folders (which I suspect it does, but I've never tested.) then it would pull the value from the Strings.xml file inside the hdpi folder if the device has high density display, so you could get a different name for those devices. Maybe using this method you could use a language modifier like values-esp and somehow force the app to go into 'spanish mode' for a certain subset of users so that it pulls this alternate value.
If I understand your question correctly, you want to know if it's possible to test different names on the Android Market, correct?
The only way to do this with the Google Market is to have two separate copies of your app, but using different package names for each. The name that appears in the Market is set on the Developer Console, and while it can be changed, you will not see two different entries for your app in the market.
This is because the market uses your package name to identify your app, not the app name that you supply.
So, while it's easy to change the display name of the app while it is running by using setTitle as #Tim and #Robby have said, this only changes the app title while it is running - it does not affect the name used in the Android package manager, and it also does not affect the name displayed in the Market.
As I say above, if you are wanting to test which name is more popular and therefore results in more downloads, you will need to have multiple apps on the market with different package names. You will also then have to consider how to handle upgrades, and if one name turns out to be very popular, I don't think there's any facility to "upgrade" the other users to your new package name since they are different packages and therefore there is no upgrade path. This means you'll either have to inconvenience users of the old name by somehow asking them to switch to the new app name, or maintain all named versions of your app for the expected lifetime of it.
If you do get your users to switch to the new app, you will then also have to consider how to migrate their data. This can be done (3G watchdog does it when you upgrade from the lite version to pro), but it's an extra layer of complexity that you can avoid.

modify a an existing Android ROM to control user actions

I am creating an Android application for a customer which will be pre-installed and distributed together with the handsets. Now the customer asked me to lock down the ROM to prevent the future users from using anything else apart from this one app. I.e. no browsing, no email, nothing which could create any costs etc.
Now after some googling it seems to be relatively straightforward to remove applications from an Android image. But even if I can remove the web browser, email client, the Android Market App etc, how can I make sure that the user will not reinstall those apps via the USB connector? As Android is just Linux I am sure there are ways of denying all users the right to install new applications (or actually denying them pretty much anything apart from using this one app).
If somebody could point me in the right direction it would be much appreciated.
EDIT:
To clarify things a bit, the customer does not want to use the android devices as phones, even though they are phones. With 100€ touch screen phones becoming available, it becomes viable to use those phones for just one specific purpose. In my customers case, the device will be used as something like a POS system: the employee uses the phone to process a certain kind of customer request, and for this the app needs to have a data connection which will accrue costs of course. Now obviously contracts can be set up that will oblige employees to pay any irregular costs themselves, but why make it that complicated?
This is not about taking freedom away from users but rather about using android phones as general purpose touch screen devices with a data connection that employees can use in a business environment without shooting themselves in the foot with unexpected high data connection cost.
There's not really a whole lot you need to do to make a single-purpose device. If you play your cards right, it should be something you can do without having to tinker with the ROM.
The quick-and-easy route would be to deploy your application as a replacement for the stock launcher, just like any of the other home replacements that are available. Setting that as the default would cover most of the opportunities for casual tampering, since it would leave no other way to launch or install anything else. The only other things I can think of off the top of my head that you'd need to do are snag the search button so it doesn't bring up the default Android search box atop your app and the green key so the phone app won't come up.
You would, of course, need a way to get to the original launcher to maintain the device and install new versions of your app. I'd accomplish that using a "Maintenance" menu item somewhere that asks for some form of authentication (e.g., a password), changes the home app back to the original and launches it. When you're done doing what you need to do, set your app as the default launcher and you're back in business.
Edit to address MAINERROR (now Octavian Damiean)'s comment:
Any activity in any application can register itself as a home application by adding an intent filter on the android.intent.category.HOME category. It's literally four lines in the manifest, and you don't have to write any code to support it. Take a look at lines 77-82 in the stock launcher's manifest for an example of how this is done. (Ignore the filters on DEFAULT and MONKEY; they're not necessary.) Once the activity is selected as the default handler for the category, it becomes the first thing launched at boot and what comes up when the Home key is pressed. HTC Sense, aHome, Panda Home, etc. all use this mechanism.
Launching the stock home (or any other application) explicitly is about five lines of code.
Side note: There's a application on the Market called Home Switcher that lets you launch any of the activities filtering on the HOME category or set one as the default.
Unless the handset manufacturer adds a lot of shovelware, the stuff that runs in the background should be inconsequential and won't get in the way.
There was a similar question already somewhere. You can indeed limit the functionality of your device by the amount you want or have to. In order to achieve this you will definitely have to build your own modified ROM.
You will have to touch the ROM because you will have to get rid of several applications running in the background. One you won't need them anyway and two as you don't need them they would only consume resources.
You might want to take a look at http://source.android.com there you will find more information about the sources which will hopefully direct you where you need.
Blrfl's answer is great, but it still has a problem: if the user long presses the HOME button, the recent applications popup will appear an the user will be able to launch another app.

Categories

Resources