Is it possible to run an application automatically on boot up as background service in J2me? - service

I wanted to develop Location Based Service in J2me which has to start automatically on Boot up & run as background service ,which will send periodic location to the server? How can i implement it on J2me ?
Any Suggestions,tips or examples will be really helpful.
Thanks

Yes, Srizan,
It is possible using the Application Settings. You need to set the Auto Start setting to true in Application Settings.

Yes I am also trying same, I went to some extent.
Yes is possible to do ,with help of Push reg which is with MIDP 2.0 Mobile app can be called after every 10 sec or so (I didn't Coded this yet)
and. to hide app use this line Display.getDisplay (this).setCurrent (null);
it will run be shown with your tab or run app again.
I am still getting some problems like, Internet will Go Off when Mobile screen goes Off.

Related

Fire Chrome Alarms from background service when using cca Google Chrome apps

Experimenting with Mobile Chrome apps API: ( https://github.com/MobileChromeApps/mobile-chrome-apps )
What I'm trying to achieve is the registering of my chrome alarms without having to crudely start the apps' main activity as this causes a bad user experience.
The challenge:
I have specified a chome.alarm which gets successfully registered when I open the app ('cca run android ' for example). These alarms are specified in a background.js file, which is declared as a background script in the manifest.json file.
I wanted these to be registered automatically on boot, therefore I implemented a background service and thought I could simply call the app to register the alarms specified in the background.js file. However, the only way I can find thus far to achieve this, is via a call to launch the apps main activity via an Intent from within the background service as explained in more detail below.
On boot, my background service simply invokes:
//Launch main activity..
Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage("com.company.appname");
startActivity(LaunchIntent);
The above launches the app into its main activity and the aforementioned chrome.alarms are registered as desired. Happy days! A massive downside to this, of course, is that no user wants the full blown main activity window to open on boot.
Please advise if there is a less clunky way to have the chrome.alarm specified in background.js registered at boot by a background thread. I do not wish to open the mainActivity of the app, yet this is currently the only way thus far I can see to get them to be registered. It is preferable not to register these alarms from within the Android SDK as I intend to stay as close to using web APIs and want to use background.js as the hook to do this keeping things in-line with chrome web apps as-well-as the android platform.
What I have done:
A cca (chrome mobile web app) app which registers a background service natively (I extend BackgroundService) as a plugin and register this to run at boot time. This is the only 'native android code' in order to load the app at boot-time.
Upon booting android, this background service then simply issues a startActivity(LaunchIntent) in order to open the app. In doing so, my chrome.alarm specified in my background.js file get registered successfully. If I don't do this, my chrome alarm specified in background.js do not get registered until I manually open the apps main activity. Therefore I use the backgroundService to open the apps main activity.
This is not at all ideal, I would simply like to somehow have my chrome.alarms registered without crudely having to launch the apps main activity window.
Is there a call which I can place in my BackgroundService to have only the chrome.alarms contained in my background.js file read and registered to fire?
Thank you for your time.
First, thanks for using Chrome Apps for Mobile! (Note: I work on the project)
Sorry that our current bootstrap is "crude" and "clunky", and we agree that it is. You can track this issue for progress on our effort to replace our current Background-scripts-embedded-in-main-Activity-webview strategy with a real background service and multiple window support. Basically you've summarized exactly our plan and existing limitations.
This work is actually scheduled for the near term, and will certainly be done before the end of the year.
As well as chrome.alarms, this feature is quite important for chrome.gcm and chrome.tcpServer (among other reasons).

ios check internet connection background process

I am building an ios application that requires internet connection via wi-fi in order to talk to web service. Now before anything, i want my application to run a background process that checks internet availability and when connected talk to web service.
Any body knows how to implement this in background process?
I already use this solution to check whether there is an internet connection or not
Easiest way to detect Internet connection on iOS?
but I want to know how to run this process in the background in order to work even the application is closed.
You can have your checks done when in foreground. Its not allowed to for an app to execute code in background continuously(although you can execute some code when you go to background initially). If you are not planning to publish this app in app store and its a enterprise solution, then you should explore ways to stay in background by running a music file (without sound) to get CPU Cycles. It worked for me..

iphone application automatic start up

is there any option in iphone so that i can start my application automatically within a predefined time interval ? For example like alarm application but we don't want our application to run in the background. thanks in advance.
There is not option like this. The best you can implement is local notification which is displayed to the user and then application can be launch via the notification.
Check out About Local Notifications and Push Notifications to know how it works and eventually implement it
No. There is no way to start your application automatically.
You can give user option to start your application using Local notification though it does not guarantee your application would be started because if user ignores local notification than your application will not launched.
There is no officially supported way to do this.

phonegap background service in iOS5

I am writing update checker program in xcode, my program needs background process( it needs to be run in background), so is it possible in phonegap, and is there any phonegap plugin for background services? Thanks
iOS does not allow background task to run more than a specific time limit.
Similar Post:
iPhone background task stops running at some point
Explanation:
http://www.macworld.com/article/1164616/how_ios_multitasking_really_works.html
The reasonable solution would be to implement a push notification and send a notification whenever there is an update on server.
It is definitely possible to run some JS code in the background to be checking this (https://github.com/jocull/phonegap-backgroundjs).
It won't be possible to do it for more than 10 minutes in the background, though (Run app for more than 10 minutes in background)
So you'll need both a combination of the first plugin I mentioned and the PN service that dhaval is suggesting.
Cheers!

iPhone background network connection by timer

I need to write an application, that every 10 minutes it should be awaken from suspended mode, get user location via gps and send this information to the server by network.
Depending on the response it should return to the suspended mode or show local notification to the user.
Is there a way to do this on iOS 4?
I've tried different approaches, but the only working for me was to start monitoring user location in backgroind and declare the application as location background application. In that case it worked in background and has a network connection. But this approach takes a lot of power and not accepted cause application should work 24/7.
May be there is a way to write some daemon that should work in background and wake my application every 10 minutes?
Apparently, Pastebot tried to do something similar with the 'audio' multitasking declaration (by playing a silent audiofile) and got rejected.. UNTIL they actually presented a option to the user to pick which audiofile they wanted to play. It's in the appstore now. :)
In this case: What is your reason for not wanting to use the location updates? If battery-usage is a concern, you can use the 'significant location changes only' option, after which you can temporarily change to a more accurate option.
This isn't possible outside of the method you have already tried.
The iPhone background task API will allow you to run a location service in the background.
There is no way to write daemons for the iPhone without jailbreaking, and that is not something I'm able/prepared to help you with.
App store friendly: use new APIs in iOS4, which allows u to make use of GPS location
Anti App store: create a daemon by adding a specific plist file to System/Library/LaunchDaemons/ and put ur app under Applications/. this approach requires a jailbroken iPhone however...
detailed information plz google the following keywords: daemon, multitask, background, etc...
cheers, Lloyd