简体   繁体   English

Android 应用问题:服务?

[英]Android app question: services?

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.我目前正在编写一个应用程序,该应用程序应该获取用户的通话和短信日志并将它们发送到远程 mysql 数据库。

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?我应该每 x 小时将数据发送到数据库,还是将所有内容存储在 Android 的 SQLite DB 中,然后在一天结束前发送所有内容?

This is my first android app and as you can see I have no idea:)这是我的第一个 android 应用程序,如您所见,我不知道:)

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.我终于使用了远程服务,因为即使应用程序可能没有运行,我也希望该服务能够运行,并且每 24 小时发送一次数据,这样会好很多。 Thanks for your help!谢谢你的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM