How to reset MetaWear Device? - android

I am currently developing an application that will use Metawear device.
I have noticed that after I connect a device, I can read the live accelerometer values of that device but I want to read/download offline accelerometer values.
For that as per I refer https://gist.github.com/mbientlab/a299fc705f8ac3b64359 , I need to set Trigger.
But when I am setting triggers and if I did not remove that trigger then next time Metawear device unable to detect/scan by my device(Suppose an android mobile).
If device totally discharges and starts again then it resets.
So is there any method to remove that trigger without connecting to the device or reset the device
Thanx in advance

Use the removeAllTriggers method to remove all logging triggers. Line 100 of the aforementioned gist demonstrates trigger removal with the removeTrigger method

Related

How to create automotive application to trigger notifation for overspeed in android studio

I want to create first application to listen car speed without open this application.
It is possible to monitor car speed in background
To listen to Car speed you need to create an object of CarPropertyManager and register for change in Car Speed Property value.(PERF_VEHICLE_SPEED) using method registerCallback() present in CarPropertyManager
registerCallback() method requires a Callback in which to receive speed updates, proprty id of Speed(Constant Value: 291504647 (0x11600207) which is mentioned for PERF_VEHICLE_SPEED in above mentioned link) and rate at which to receive these updates.
Put all code in a service to receive updates in the background.
You can find samples for the Android Automotive application at https://android.googlesource.com/platform/packages/services/Car/+/master/tests/EmbeddedKitchenSinkApp
I have tested sample apk with automotive emulator.
My apk contains some services to run some code on background.
when my app is open in emulator, services are running successfully. But I try to minimize the app services are stopped automatically.
there any restrictions in automotive os or we need to follow any procedure to use services in our app.

aprirtc call_crossing_detected error when calling from android to android

My ionic angularjs corodova app works great when receiving calls from the demo web page on chrome. When I try to initiate a call to the demo site or another device, whether using demo API key or real api key, i get
call_crossing_detected
What does this mean, and how do you fix it?
More details on symptoms. When this occurs, no video comes up and the initiating device shows the error and the call button remains. But the receiving device switches to the hangup button, which then works. And if you speak into either device the receiving device receives the audio, but nothing on the initiating device
"call_crossing_detected" reason appears on hangup event when a call is already established between the two users and you are trying to establish a new one.
So I think you may have an issue on the first call hangup.
I have resolved this issue. It was caused by apiRTC.init executing more than once.

Android Wear: getDataItems returns 0 items

Here is a big problem that i simply don't know whats going on...
I have an app that stores Data in data API. The mobile app is aroudn the play store for some time and I decided to make a app for wearable.
My problem is: when the user install the wearable app for the first time (via Google Play), it need to load the data from the DataApi. But it simple returns 0 itens!
DataItemBuffer dataItems = Wearable.DataApi.getDataItems(mGoogleApiClient).await();
Observations:
GoogleApiClient IS CONNECTED
The Wearable receives the onDataChanged from WearableListenerService and this part is working fine.
I've already tested with .setResultCallback but results still the same.
I have two copmuter for developments, one is one my work and another is on my home.
In my tests, I DELETE the emulator and create a new one, to simulate a "new device beeing connected for the first time".
DataAPI says that the data is synchronzed to all devices but is seems not be working like that. How to solves this? Any workaround? SOMEONE HELP =(
It seems i found the solution for this problem. As I mentioned i have two computers for development, so, 2 development keys.
My mobile app was installed using the "A" computer's key and the wearable was using the "B" one. So, to solve this problem, when start developing always remember to re-run the mobile and wearable app from the same computer to your devices.

Samsung Chord as a Backgorund Process

I am going to enter the Samsung 2013 app contest, and one of the requirements is that you use their Chord API http://developer.samsung.com/chord.
I plan on allowing users to send messages to all phones that have my app installed. From what I gathered from the information in the previous link, this means that I will need to have a constantly running background process for users to receive the messages when they are not looking at the app at the time.
I want to know if this is true, and if so, is this viable? I am considering using the method detailed here: Android: keeping a background service alive (preventing process death) if I go ahead with this.
I'm trying to use Samsung Chord too. I thing you don't need to do this. Samsung's API Chord already provides this control.
According Chord's API:
"If a Chord node doesn’t receive a UDP signal within a specified amount of time, it considers the “missing”
node to no longer be part of the network."
And, the only thing you have to do is:
"A node cannot receive a UDP broadcast if it is in LCD-off status. Therefore, if developers want the node to discover other nodes while the application is running, the node’s status should be set to LCD-on. To do this, use Android’s PowerManager.WakeLock."
Best regards,
Adriano

Stopping a sensorListenser

I add a sensorListener(code from to my app, the allow the user shake the phone in order to start the game.
How do I disable the sensor after the first shake?
I got the sensor code from here
The API indicates that there is an "unregister method":
http://developer.android.com/reference/android/hardware/SensorManager.html#unregisterListener%28android.hardware.SensorEventListener,%20android.hardware.Sensor%29
After you have received your event you can use the Sensor Manager to unregister it - but your current code may use deprecated methods. You may want to have a look at this API to make sure it is up to date.

Categories

Resources