我正在开发一个在后台运行的服务,它可以将成功的图像和数据上传到网络上.
现在我想上传相机拍摄的图像.
在Android 2.2上没有预览的情况下,是否可以在后台服务中使用相机?
我在网上发现了各种对比剂的答案......
我该怎么做?
我正在开发一个Android版服务,必须在后台运行,每100秒执行一次函数.那是源代码(例子)
package com.example
import ....
public class Servizio extends Service {
public IBinder onBind(Intent intent) {
}
public void onCreate() {
}
public void onDestroy() {
//here put the code that stop the timer cycle
}
public void onStart(Intent intent, int startid) {
//i want to begin here the timercycle that each 100 s call myCycle()
}
public void myCycle() {
//code that i can't move on other class!!!
}
}
Run Code Online (Sandbox Code Playgroud)
我怎么能这样做?现在服务执行myCycle()一次,因为我在onStart()中调用了一个调用.