Android :: Application & ApplicationContext ?
Aug 13, 2009
Since activities are the things that interact with the user, they are the only things that can directly show UI. The Application class exists because my arms were twisted into making it. There is nothing actually all that useful about it, as far as I am concerned. ;)
We have several proxy interfaces where we make calls to backend services -- I thought a specialized extension of Application would be useful to hold these proxies as well as a client interface where we make the call, to reduce the number of objects being created and cutting down on Garbage Collection. A singleton if you will. Is this an erroneous assumption?
I also was using the Application as a location to fire off a thread to load globally accessible data needed by the application -- should I move these into an Activity and store the data in the sqllite? It seems like a lot more work to store them in a database if I'm just going to query them the next time the app pulls them down. I plan to write a mechanism to sync the data to local sqllite in the future, I'm just short on time.
I'm currently running into a problem where I'm getting an NPE back from a subsequent activity where this data is not found--even though I saw it being loaded in my Application subclass and stored there.
View 2 Replies
Sep 29, 2009
I was going through the code for Activity.java and ApplicationContext.
Both these classes define many functions of Context Interface. Take for example startActivity.java
Activity Class has its own implementation of startActivity ApplicationContext class also has an implemenetaion of startActivity.
Now there are 2 observations...
CODE:..........
Questions: 1. Who uses ApplicationContext class? 2. Does Activity class ever deal with ApplicationContext class (as given in the javadoc comments of ApplicationContext.java).
View 4 Replies
View Related
Apr 20, 2010
I have a static Preferences class that hold some application preferences and stuff like that. Is it ok to store reference to ApplicationContext there? I need that reference so i can get cache folder and stuff like that in classes that don't inherit Activity.
View 1 Replies
View Related
Jul 6, 2010
CODE:.......
What is the 'HelloGridView.this' refers? why it is called as appliactioncontext?
View 1 Replies
View Related
Sep 7, 2010
Do static variables of an ApplicationContext subclass left untouched when the process is killed?
View 4 Replies
View Related
Sep 3, 2010
I have built an SMS application and install it on my HTC Hero. but whenever i receive an SMS i receive 2 copies.How can I make this application as the default application to send and receive SMS.
View 1 Replies
View Related
Nov 15, 2010
I want to add a big feature to an application i am developping, but as this feature interest few people and is quite independant from the main part, I would like to put that in a seperate "plugin" application.Does anyone knows any design patterns, snippets, "reference" examples about such design?In particular that separate plugin application should be able to access some tables in the main application DB. Is it possible to do that without broadcast receiver? - the main application uses a TabActivity: is it possible that a the tabactivity instanciates an Intent Activity that is part of the plugin? - does the plugin can access main application preferences (not sure this would be necessary, but better to anticipate the question!) is it possible from the plugin to access main applications ressources?At least the 2 first points are mandatory for me.
View 4 Replies
View Related
Sep 21, 2009
Does anyone has an idea of how to split the screen into two? Is it possible for me to run an application in one screen and another app in other screen?
View 11 Replies
View Related
Apr 20, 2010
My application is a trial version apk. Once the period is completed, can I initiate another application to be installed/downloaded from the android market ( purchasing process) which is a paid application using the current running trail application.
View 1 Replies
View Related
Sep 21, 2010
I guess that Android won't let people to do this, because they think they have perfect handle for the task/applications. However, I really need to do this in my case.
I have an activity A acting as the entry point of my application. In that activity, it reads the preference and decided which activity to start, say B or C. After that, it finishes itself. So, activity A never appears to the users.
My application stores things on sdcard, and reads from it constantly. So, when the sdcard is unmounted, I need to display a message to the user that the sdcard is unavailable, instead of opening B or C. I set a check in A to display that message when sdcard is unavilable. When that message is displayed, A will not try to start B or C.
Things works perfectly if user only enter my application from application launcher. However, I found that user can also enter my application by long pressing home and choose it from the recent application list, if he has opened it recently. When user does that, it skips A and goes directly to B or C. I don't have the check in both of them, so exception is thrown while I am trying to access sdcard, and force close dialog pops up.
I can simply move my check to both B and C to fix this problem. But in the future, the number of activities started from A will increase. If there are 6 of them, I'll need to copy this check to 6 places. Needless to say, this looks very ugly, and is a maintenance nightmare.
So, the best fix should be removing my application from recent application list when the sdcard is uunmounted. However, I can't find how to do this. Even killing the process or use ActivityManager.restartPackage, it still appears in the list. Can anyone tell me how to remove it from the list?
View 2 Replies
View Related
Jun 13, 2009
understanding why in my emulator, i can * in my settings-> manage application, see an entry for an application there * but i cant' find the icon for launching that in All Application. how can I make my application launches on the emulator?
View 6 Replies
View Related
Feb 6, 2010
I want to add a flag that will tell how much time my application is running. This flag will have to stay even after the application is removed. And, if its installed back, i must have a way to recover this flag. What's a way to implement this?
View 8 Replies
View Related
Sep 4, 2010
I am developing an Android application for which I would like to add Facebook functionality using Facebook's Android SDK. I have registered the application and acquired the ID and Secret, but what is the point of the URL? Am I supposed to install something on my website on that specific URL so that I Facebook can do the OAuth key exchange?
View 1 Replies
View Related
May 30, 2010
I want my app to kill a running app but i got the problem that since AP I 8 the method is deprecated and i need to use another function. So i want that if AP I level of the device is smaller than 8 it runs this
Activity Manager a M = (Activity Manager) this.get System Service(ACTIVITY_SERVICE); a M.restart Package(package); And from 8 this But how do i accomplish this because using something like an if will make the compiler complain.
View 2 Replies
View Related
Jan 6, 2010
I want to launch another application through the current application.
In RIM there is a "ApplicationManager.getApplicationManager().launch("String path")" method that launches directly RIM application mentioned in "String path".
Is there any method like this in android or any other way to solve this problem ?
View 2 Replies
View Related
Nov 1, 2010
Is there any way to hide an application icon from Android applications list ? The application should be downloaded from Market and opened some GUI for configuring my application. I don't want to see any icon of my application in applications list. User should not be able to run it.
By the way I know some way:
remove this line from manifest
<category android:name="android.intent.category.LAUNCHER" />
But it is not worked for me, because the GUI is not shown.
View 6 Replies
View Related
Nov 1, 2010
Is there any way to hide an application icon from Android applications list ? The application should be downloaded from Market and opened some GUI for configuring my application. I don't want to see any icon of my application in applications list. User should not be able to run it.
By the way I know some way:
remove this line from manifest
category android:name="android.intent.category.LAUNCHER"
But it is not worked for me, because the GUI is not shown.
View 2 Replies
View Related
Aug 24, 2010
I have published application and now I'm making update to it. I changed applications Data structure and moved all files under /Android/ data/<package_name>/files/ folder.All files that are in that folder will be automatically removed when application is uninstalled.I want those files to be removed when application is uninstalled but not when it's UPDATED. I don't want users to lose all their data after every update. I don't know how to test it (without publishing new release). So will those files be deleted when user updates my application?
View 5 Replies
View Related
Aug 5, 2010
I have a wizard application that I want to make Home application. How can I convert regular application into a home application.
View 1 Replies
View Related
Jul 27, 2009
Is it possible to attach Menu to an application rather than each activity in the application? I have 20-23 activities in my application and it doesn't make sense me to add same menu to all the activities.
View 5 Replies
View Related
Jul 10, 2010
I am new to this Android application Programing. I need to know the thing that, disable and hiding of one application from application menu list. instead of deleting the entire application, that need to do some other changes to hide and disabling any application from menu list.
View 2 Replies
View Related
Nov 5, 2010
I have downloaded a file manager application called "AndExplorer" inside my Android emulator.
My goal is to call this application inside my current custom application.
View 1 Replies
View Related
Jun 27, 2010
Is there any way to expose the methods of one application to another application in android. Suppose that I have written a slider for one application and if i want to use the same slider in some other application, How can I do it without copying the source.(Both the applications are installed on the device).
View 2 Replies
View Related
Jul 15, 2010
Say I have app A, in app A i want to set a schedule to startup the app B and C at specific time?
Is it possible to do that? if yes how?
Just need to know the code to fire the outside app.
View 4 Replies
View Related
Sep 29, 2010
I have web application for mobile (developed in .net), I want to use iPhone maps application from web application( i.e. from web browser on button click)..how to do it? I want to do same in android to.
View 2 Replies
View Related
Feb 21, 2010
I would like to know if it is possible to launch my application whenever a new entry is written to phone call log (i.e. out-going, in-coming or missed call). I wrote an application to manage the call log entries as per user preferences by listening to the publication of android.intent.action.PHONE_STATE events. My application is working fine as long as its process is running. However if the user has stopped my application with a task-killer application, then the log entries can not be managed as my app itself was not running. I need a way to make sure that my application is launched in the background if it is not already running when the android.intent.action.PHONE_STATE occurs. Or is it possible to launch my application as a service that always runs?
View 2 Replies
View Related
Aug 26, 2010
I am trying to install an application from within another application. I know the usual way it to launch an intent with Intent.ACTION_VIEW, present it to the user and let him agree and this works. What i would like to do is perform a silent install, with no user interaction. I'd like to mention that my application is a system application, it has system rights! Still i can't seem to install it using
CODE:.........................
in my manifest and used this code:
CODE:......
I get "No Activity found to handle Intent" on logCat. What is the correct intent to launch the installer?
View 8 Replies
View Related
Sep 1, 2010
I'm beginner of Android.I want to run my first application on emulator. I use eclipse.I don't know what's happen. I installed my apk. I "register" my acitivity in manifest file, but I can't see it in list of application. When I open manage application setting it's written that my apk is installed. I searched about it everywhere. Even in faq of Android Development there is post about but I did all this things.
View 1 Replies
View Related
Aug 12, 2010
This is my target:
I need an Android application which should be able to fetch data from the web (maybe an .apk or a .jar) and launch "something" from it.
If it's a "trivial" class there's no problem at all. This is my Loader
CODE:.............
The problem is that the code I want to execute looks very like an application, which should have a "simple" view and some interaction on it.
I'm not able to invoke the "onCreate" method of my downloaded class.
I guess I've three streets:
I look for a method which silently install the application and then runs it (is it possible?) I understand how to initialize a second "application" inside my own one (with its own R and all stuff) I write my master program to fetch data from the web and construct pages dinamically.
View 2 Replies
View Related
Feb 1, 2009
I want to create a global variable store for a list of user defined objects. I have a LinkedList of Feed (a user defined object) that I need to be made available to a new Activity that is created. This list is displayed using a ListView and so when an item of the ListView is clicked, I need the correct Feed index to be 'passed' to the new Activity. I have no problem doing this as I create an Intent and then pass the id of the selected row. I need the new Activity to have access to the LinkedList of Feed objects.
There are different ways to do this (explained here - http://code.google.com/android/kb/framework.html). I want to use the option (quoted from link above): The android.app.Application class The android.app.Application is a base class for those who need to maintain global application state. It can be accessed via getApplication() from any Activity or Service. It has a couple of life- cycle methods and will be instantiated by Android automatically if your register it in AndroidManifest.xml.
I want to use the above method as I could then fill the LinkedList at application start and then use it throughout without any duplicates etc. Does anyone know how the android.app.Application class can be used as a global variable store that can be accessed from other classes? I cannot find any more information on this method of passing information between Activities within a single application. Any information regarding passing user defined objects would be useful and specifically how to get the above idea to work.
View 4 Replies
View Related