小编Tik*_*aka的帖子

Android OBD-II蓝牙API示例代码无法正常工作

我需要开发一个从OBD-II蓝牙适配器检索数据的Android应用程序.首先,我从https://code.google.com/p/android-obd-reader/下载了API,并尝试在其中运行示例应用程序,但它对我不起作用.有人能告诉我谁使用了该API以及该代码的错误在哪里?它上面有很多包和类.我无法澄清它们.

api android bluetooth obd-ii

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

如何使用Android应用程序将数据发送到网站

我正在尝试将一些数据发送到我的网站.单击该按钮时,需要将数据发送到网站

但是当我运行程序时,我遇到了一些错误

当我点击按钮时,此消息显示"不幸的是app已经停止",然后退出我的应用程序.

 public class testInput extends Activity {

Button Setbutton;

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);


    setContentView(R.layout.test_input_page);

    Setbutton=(Button)findViewById(R.id.setbtn);

Setbutton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
        testInput ti=new testInput();
            //Create the intent



           ti.postData("Sent Data");


    });

}

public void postData(String toPost) {
    // Create a new HttpClient and Post Header
    HttpClient httpclient = new DefaultHttpClient();
    HttpPost httppost = new HttpPost("http://mysite.com/index.php");

    //This is the data to send
    String MyName …
Run Code Online (Sandbox Code Playgroud)

post android http send

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

在android中设置延迟

我想在我的应用程序中显示1到9个数字作为计数器


TextView te=(TextView)findViewById(R.id.text);

for(int i=0;i<10;i++ ){ try { te.setText("Number"+i); Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } }
Run Code Online (Sandbox Code Playgroud)

但这并没有给我想要的我怎么能这样做
谢谢你

android counter for-loop

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

标签 统计

android ×3

api ×1

bluetooth ×1

counter ×1

for-loop ×1

http ×1

obd-ii ×1

post ×1

send ×1