小编Lor*_*ork的帖子

如何使用相机在Android上的后台服务中拍照?

我正在开发一个在后台运行的服务,它可以将成功的图像和数据上传到网络上.

现在我想上传相机拍摄的图像.

在Android 2.2上没有预览的情况下,是否可以在后台服务中使用相机?

我在网上发现了各种对比剂的答案......

我该怎么做?

java camera android

11
推荐指数
1
解决办法
2万
查看次数

如何在Android中没有新类的简单计时器?

我正在开发一个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()中调用了一个调用.

java android timer

3
推荐指数
1
解决办法
8287
查看次数

标签 统计

android ×2

java ×2

camera ×1

timer ×1