Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Message Not sending and Receiving #3

@ashishoc

Description

@ashishoc

Hi,
Your android code not working even not sending messages or receiving.
What I did here???
I upload your arduino code in my arduino nano board. Then develop arduino app for simply connect and send message using your code. But no luck.
How I know???
I try S2 terminal App It's working. Your arduino code well responding with S2 terminal.
Problem:
Device is connecting well with arduino but not sending & Receiving msg even not throwing any exception.
Here is my activity...

    public class MainActivity extends Activity {
BluetoothArduino mBlue ;
 @Override 
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mBlue = BluetoothArduino.getInstance(this,"Arduino");
    mBlue.Connect();
    Toast.makeText(this,mBlue.getLastMessage(),Toast.LENGTH_SHORT).show();
     Button b=(Button)findViewById(R.id.buttonOn);
     Button c=(Button)findViewById(R.id.buttonSearch);
     b.setOnClickListener(new OnClickListener(){

             @Override
             public void onClick(View p1)
             {

                 mBlue.SendMessage("Hi from Android!");
             }


     });
     c.setOnClickListener(new OnClickListener(){

             @Override
             public void onClick(View p1)
             {
                 Toast.makeText(getApplicationContext(),mBlue.getLastMessage(),Toast.LENGTH_SHORT).show();

             }


         });
 }



}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions