Monobrick android app problem

HomeForumsMonoBrick Communication LibraryMonobrick android app problem

This topic contains 0 replies, has 1 voice, and was last updated by Author Image Tomasz Rozwadowski 2 years ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #5553
    Author Image
    Tomasz Rozwadowski
    Participant

    Hi,
    i’m trying to do simple Android App. App have to connect with EV3 by bluetooth, there will be one button, and when you press this button app have to turn on one sequency.

    First i have problem with xamarin project. I’m doing it at Visual Studio 2013. This is my code :

    `using System;
    using Android.App;
    using Android.Content;
    using Android.Runtime;
    using Android.Views;
    using Android.Widget;
    using Android.OS;
    using MonoBrick.EV3;

    namespace MonoBrick
    {
    [Activity(Label = "App2", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {

    void Main(string[] args)
    {
    MonoBrick.Bluetooth<BrickCommand, BrickReply>.IsEnabled;
    MonoBrick.Bluetooth<BrickCommand,BrickReply>.Enable();
    MonoBrick.Bluetooth.BondDevices;

    var device = MonoBrick.Bluetooth<MonoBrick.EV3.Command, MonoBrick.EV3.Reply>.GetBondDevice(“youDeviceName”);
    var connection = new Bluetooth<MonoBrick.EV3.Command, MonoBrick.EV3.Reply>(device);
    var bricked = new MonoBrick.EV3.Brick<MonoBrick.EV3.Sensor, MonoBrick.EV3.Sensor, MonoBrick.EV3.Sensor, MonoBrick.EV3.Sensor>(connection);
    bricked.Connection.Open();

    }
    }
    }
    Image from Visual Studio

    First question, what i have to do wrote in youDeviceName and second, what i’m doing wrong?

    Attachments:
    You must be logged in to view attached files.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Posted in

Make a donation