Hi All,
This threat should be posted into "Android Software Development" category but because I'm new here I can't do that.
I'm building an RSS feed aggregator application.
It has an UI where user can read the aggregated RSS items and it has a service that is running in the background to fetch RSS feed periodically.
The service must run even if the UI is closed.
The service started in START_STICKY mode by the UI activity's onCreate() overrided function, then the service register a timer.scheduleAtFixedRate() in it's onStart() overrided function for the scheduled job (feed receiving).
It is working fine, if I leave the UI then the service keeps running and the scheduled job is executed in right way but here comes my problem:
If I leave the UI with "back key" and not with the "home key" then next time I starting the app it's UI activity onStart() will run again, it will call startService() again and because of that a new timer.scheduleAtFixedRate() will execute and it will extend the scheduled jobs with a same one, so after that 2 scheduled jobs will run and every time this "UI restart" happens a new scheduled job will registered.
I saw lot of tutorials in this topic, but those are contains user interaction based service start/stop (for example start/stop service with button) with UI lifetime services and they don't handle this problem.
So my questions are:
- What is the right way to start these type of services?
- What is the right way to take care about scheduled job registering or how can I prevent this multiple job registration?
Thank you for your help!
Andrew
I made a workaround to fix the issue.
In my service class I defined a boolean variable what is basically false and it will change to true when the first scheduled task is registered and the task registration in the onStartCommand() function is only happens when the boolean variable is false.
In this way everything is working fine but I'm not sure that this is the right way to handle the problem...
Related
I'm developing an SMS scheduler android application, and would like to include my app in the chooser when a user is trying to send an SMS outside of my app.
i.e. after using the voice commands to create a message, it asks which application you'd like to use to complete the task.
I'd like to add my app to the chooser for as many starting points as possible, including possibly the ability to intercept a message after you press send in the messaging app, and ask if you want to send it with my app.
I believe I should be using intent filters with particular mimetypes, but I dont know which ones. Is editing the manifest all I have to do?
EDIT: is this the correct thread?
So I've been working on sending information from another activity in the same app. I have a main menu activity with a listview containing pending messages and a compose activity which can accept strings, etc to load into the edittext fields. (This works)
Do I need this bundle to be in a particular SMS formatting (keys for Strings and such)?
No it belongs in android development.
I am new to Android development, hence kindly forgive any unintentional mistakes, if made.
I have a native activity rendering using ES2.0. The app needs to start twitter authentication (it uses twitter4j).
I am starting a new activity with twitter auth url. It shows the login page. I give userId, password, the native browser says now it would be redirected to the previous page or something. Then I see a black screen which apparently is the default browser still on top of the application. If I go to home, and background processes, I see my app and the browser as separate activities which makes sense.
Now my question is , how do I code my app to return back to the application once the authentication ends?
Here is the code flow to start the new activity
1. Native code calls JNI function to start authorization
2. The Java function creates an AsyncTask, in doInBackground() it gets the request token using getOAuthRequestToken(URL) where URL = custom url "app1://callback".
3. in onPostExecute() , app starts new intent activity using this code
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(requestToken.getAuthenticationURL()));
BaseGameActivity.startActivity(intent);
Log.debug("authenticate task post ends");
:laughear all, able to add tel,address... to description of event while long press on description field. This function is incredible useful to make a call to those people who relative to this event. I haven't seen any similar function except calendar of Palm OS.
Is anyone willing to developing an app to implement the function?
a activity pops up while long press on description of event, and allowed to pick up(or filter) contact whose info will be added to.
I am learning about android coding for 2 weeks. This will be my first to archive
Like everyone, I have to submit a Permissions Declarations Form for one of my apps, GVoice Callback, whose sole purpose is to Proxy Calls, which is an approved use case for three sensitive permissions: android.permission.PROCESS_OUTGOING_CALLS (for intercepting call), android.permission.READ_CALL_LOG, android.permission.WRITE_CALL_LOG (for maintaining a correct call log when calls are canceled).
For some reason, Google just won't approve it. Their policy enforcers kept responding that "We couldn’t verify the declared core functionality of your app during our review",despite multiple strenuous efforts to prepare video demos and detailed explanations to demonstrate how my app's core functionality is to Proxy Calls. Asked to clarify what part should be explained more, Google's appeal team simply replied that they could not give a better answer than the same stock, unspecific message I had already received.
Not sure if this is a common experience. I know that task automation, call recorder type of apps have been struggling with this issue, but my app is straight up a call proxy, but they just won't see it. I would think even without the video demo and the additional explanations I gave in my request, it'd be pretty obvious from the store listing (which is the same text here: gvoicecallback_netlify_com/#overview). I'm giving up now...
I have the following privacy policy which is located here: http://minutewalks.inthepress.biz/PrivacyPolicy.html The text of the policy is:
MinuteWalks Privacy Policy
This app collects location data. The data collected remains on your device and is only stored and used in order to calculate the distance you have travelled. All the analysis is done on your device. No data is communicated to or shared with us or anyone else. No data is stored after monitoring is stopped. Monitoring continues in the background in order to allow you to continue receiving audible notifications and carry on using other apps to listen to music, provide other fitness monitoring or anything else you want to do. So long as monitoring is ongoing you will see a notification. You can stop monitoring at any time by pressing the stop button in the app. If you have closed the app you can restart it as normal to stop monitoring or you can restart it by tapping on the notification.
Click to expand...
Click to collapse
Google just keep saying: "make sure your privacy policy specifically covers user privacy" and are marking my app as non-compliant.
Can anyone help me understand this so that I can fix it?