patloew / RxWear

⌚️ Reactive Wearable API Library for Android and RxJava
Other
158 stars 14 forks source link

rxWear quite simply NOT WORKING #10

Open thoughtcastdavid opened 5 years ago

thoughtcastdavid commented 5 years ago

I tried making a basic app that sends small data to my wear app, and my wear app should just Log.d "ok..." to see if the data was received.

It does not:

here is my wear app;

  RxWear rxWear = new RxWear(this);

        Log.d("MEx", "  ok  ! ");

        rxWear.message().listen("/dataMap", MessageApi.FILTER_LITERAL)
                .compose(MessageEventGetDataMap.noFilter())
                .subscribe(dataMap -> {

                    Log.d("MEx", " lol " );

                });

That is the relevant code.

Here is what I do in my mobile app:


 public void sendPoint(Point b)
    {

        long[] pointz = new long[3];

        pointz[0] = b.x;
        pointz[1] = b.y;

        rxWear.message().sendDataMapToAllRemoteNodes("/dataMap")
                .putString("title", "Title")
                .putLongArray("point", pointz)
                .toObservable()
                .subscribe(requestId -> {
                    /* do something */
                });

    }

What am I doing wrong?!!

MarkerwApk commented 5 years ago

try add : pointz[2] = System.currentTimeMillis(); Source

thoughtcastdavid commented 5 years ago

Still no.

thoughtcastdavid commented 5 years ago

Update:

I changed my Wear app to this:

rxWear.data().listen("/dataMap", DataApi.FILTER_PREFIX).subscribe(dataEvent -> { Log.d("MEx", " test tt");});

and my Mobile app to this:

        long[] pointz = new long[3];

        pointz[0] = b.x;
        pointz[1] = b.y;
        pointz[2] = System.currentTimeMillis();

        rxWear.data().putDataMap().to("/dataMap").putLongArray("point", pointz);

I think im getting close...