0

Hi I want to connect bluetooth and laptop

What I want to do is, send numeric value from android application to Labview program installed in Laptop.

The android program returns value which changes according to the button click.

(When I press up button, value +1).

And I want to send this value to the laptop via bluetooth!.

I was looking for google, stackoverflow and other many communities., I couldn't find any hints or solutions.

package com.u2ring.control;

import com.u2ring.control.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.webkit.*;


public class MainActivity extends Activity implements OnClickListener
{
Button Plus, Minus;
TextView Value;
TextView url;
int score = 0;


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Plus = (Button) findViewById(R.id.up);
Minus = (Button) findViewById(R.id.down);

Value = (TextView) findViewById(R.id.number);

String host = getString(R.string.host);

Plus.setOnClickListener(this);
Minus.setOnClickListener(this);
Button bt1 = (Button) findViewById(R.id.button2);
bt1.setOnClickListener(new View.OnClickListener(){
    @Override
    public void onClick(View v){
        Intent in = new Intent(MainActivity.this,Secondpage.class);
        startActivity(in);
        }
});};




public void onClick(View v)
{
boolean showText = false;

int id = v.getId();
if (id == R.id.up) {
    score++;
    showText = true;
} else if (id == R.id.down) {
    score--;
    showText = true;
} else if (id == R.id.number) {
    showText = true;
}
if(showText)
Value.setText(String.valueOf(score));

WebView wv= (WebView) findViewById(R.id.web);
wv.loadUrl("http://10.16.27.184:8080/admin/speed/"+Integer.toString(score));
}
}

1 Answers1

0

There is a nice Bluetooth example with code for LabVIEW and Android on LabVIEW Hacker.

Chris
  • 171
  • 4
  • But I cannot see the source code...I asked the admin of LabView hacker for the source code, but he said he doesn't have that outdated fiel – user3731137 Jun 13 '14 at 05:04