I am currently programming an app that is supposed to get the users' calls and SMSs log and send them to a remote mysql DB.
I have a preferences screen and a checkbox for calls and another for sms logging and I want that when the user clicks in the checkboxes and then saves the preferences clicking a button, the logging starts to work (depending on whether the checkboxes were clicked or not).
My question is, should I implement each of the logging feature in services?
Remote or locals?
I'd like the logging working ALWAYS until the users unticks the checboxes and saves preferences.
Should I send the data to the DB every x hours, or just storing everything in a SQLite DB in Android and then sending everything by the end of the day?
This is my first android app and as you can see I have no idea :)
Thanks everybody for your help!
Cheers
I am finally using a remote service, as I want the service to be running even though the application might not be running, and will just send the data every 24h, so much better.
Thanks for your help!
Related
Good evening!
I'm developing a chat application that looks like WhatsApp. I need the received messages to be saved on the user's mobile device. Until then everything was ok, because I was saving the messages when the user received the push notification on the mobile, but the problem happens when the application is closed because when the application is closed the push notification does not trigger the received push event (I am using the Onesignal to send the push).
I'd like to know how I can do this, ie get a notification and process it even with my closed application. I think it has to do this because Whatsapp does this and also Spotify also does it when I connect the Spotify to another device it automatically forces the opening of the application on my cell phone.
So my question is, how do I handle an event with the application closed or even force it to open according to a particular event?
I'm using the technology of Ionic 1 and Angular.js. For push notification I am using the OneSignal provider.
Thanks in advance for your attention and hope someone can help me. Thank you!
I'm fairly sure you won't be able to do what you're describing. There is a 'background push' feature introduced in iOS 9 that lets an app receive a payload triggered via push even when it is closed, but that's more for downloading (for example) a new edition of an online magazine, rather than lots of messages.
The difference betwen those two use cases is that if you're subscribed to a magazine, you might want the latest issue to download automatically whilst you have an internet connection, so that you have the issue to read when you're flying/on the train or whatever. A chat app... is pretty useless if you're not connected to the internet anyway, so there's no urgent need to have new messages 'pre-downloaded'
Even if you could do it, I don't think it would be best practice as there's too many scenarios where people won't have internet anyway so you're going to be left without the full message history when a user opens the app (not to mention push notification delivery is not tracked or guaranteed), so you're going to have to do some sort of query when the app launches to download new messages anyway.
If you've got code already that checks and downloads new messages while the app is open, that's great. But if its closed, you'll just need to run some sort of query on launch to download unread messages or something like that
I have developed an android application of a college. This application contain all the teachers and employee basic info such as photo, name, phone,email. I want to add an update button in this application. If the user press this update button the application will update. I will keep data for updating in a web server. when user press update option the app will take update data form that web server. For this, which way I can develop this application Can anyone help me? Please.
you can use may be an AsyncTask to fetch the updated data, and in the onPostExecute method of Async Task, you can update all the views you need to update.
I am making an android application which communicates with my server every time the user logs in. I am trying to make it so that the server will know when a user is logged in or not (basically keeping track of their activity). However, if the device goes offline suddenly and doesn't have time to "logout" from the server, my server will never know that it is offline until the app requests the logout method. I am using baasbox for my backend. Can someone help me fix this? Thanks in advance :)
I have two threads, each of which handle syncing data one way either from the server or to the server. The thread for getting data off the server needs to run once a day. The other sending data to the server needs to run every 15 mins. I am currently using an Alarm Manager to create repeating alarms for each of these threads. This is then received by a BroadcastReceiver, from which i call an activity, which then according to the data passed into the activity either runs the to server syncing thread or the from server syncing thread. I am using the activity to display a dialog box, to prevent the user from using the application until the syncing has been completed as they both access the database required by the application. Is this the correct way to accomplish this task, or are there better alternatives?
Thank you in advance
This question is not really fit for SO... This is more a debate without any details on how your app works.
Anyway I would use an Android Service to do so. You do not need to bother the user just to upload data. Also why block the use of the app for uploading? Since for uploading you only need to read, just make a snapshot of the current data and upload it. Any changes the user is making right now will be uploaded in next upload, so that's not a problem.
For downloading, you most likely do need to block the app use, but maybe not. This depends on how the app works. You could start DB transactions to avoid doing that.
I am want to do registration in my app. So i have made all requests to my web service.
I now when user is registered.
Now i need to save somewhere that he is registered that don't give him registration form again.
How to do this ?
Do i need to save somewhere in my sqlite database and every time when app lunches check if he is registered user. Or maybe in app settings i could save this information.
I am new to developing android app and i am searching for the right way.
Thanks all for help.
You could save that with SharedPreferences. Check the link for sample code.
http://developer.android.com/guide/topics/data/data-storage.html#pref.
This data will be removed if the users uninstalls the app or clears all data from system menu.
Edit: If you really want to remember preferences across installs you should try Backup API. http://developer.android.com/guide/topics/data/backup.html
The best solution is to use Android's Account Manager to handle user account. This aproach is the most secure (credentials are not exposed), however it has two drawbacks:
It's a little bit complocated to set up
It requires at least API version 5
Once the user registered you can save in your sqlite database and you have to check for each time when your application launches. But if the user uninstalled the application and tried to reinstall it ll ask for registration again.. In order to avoid this you have to store the information like the device id and the registered details in some servers and also in sqlite database and have to check when the application launches...