How do I set the DataSource as Mi Band 2(or anything other than my phone) for finding the sensors for counting steps using Google Fit? - android

I a noob in android.
I am able to get the step data from my phone, but i want the data of my fitness band ie mi Band 2. Till now I have been able to connect the Band using the conventional method of connecting the BLE devices. After connection I am not able to get the data from the Band.
Is it even possible to get the Band data using Google Fit API or shall I do it using the Mi-Band-SDK available on GitHub : https://github.com/pangliang/miband-sdk-android ??

If you want to use the Google Fit API, then you need to check this documentation on how to List available data sources.
It is explained here that to get information about the device for a data source, use the DataSource.getDevice method. The device information is useful to distinguish from similar sensors on different devices, show the device information from a sensor to the user, or process data differently depending on the device.
For the Github that you link, I'm not sure if this is still working. As you can see here they already stopped the maintenance in this Github, but you can still give a try here and check if it's still working.
I found here another Github that might help you.

Related

Sending Sensor Data to a Mobile App For Others to See

hope you are all doing well.
I am trying to create a mini project with 3 of my friends. Our aim is to get real time data from several sensors, such as body temperature and location, and displaying them to other people via a mobile application. Two of my friends are little bit experienced in mobile app development and I know how to work with the necessary sensors. We just do not know what would be the best and easiest way to having the app show the real time data. I thought about sending the instant sensor values to Google Cloud and then transmitting the data to the application. I do not know if this is a feasible way, or sensible if it would get the job done.
What are your ideas? I am aware that this might be a very broad question, and apologise for that. Looking forward to your assistance!
This is likely to be shut down, as it's definitely too broad of a question.
Having said that, in broad terms...if you want to use Google Cloud to do this: Check out Google Cloud IoT Core for getting the sensor data into Google Cloud, which will put it into a Pub/Sub topic. Then from there you can ingest it into a Firebase/Firestore database (using something like a Cloud Function, or an App Engine polling application) which can then serve up the data in real time to your applications. Mobile apps can "subscribe" to data changes in the Firebase database, which allows them to easily read things in real time.
I basically did this for a talk I did at Google Next a few years ago, the code is in this repo:
https://github.com/GabeWeiss/GoogleIoTCoreApp
Device code is for a Raspberry Pi, but if you're comfy with sensors, that part is easy.
gcf are Google Cloud Functions that shuttled the sensor data from Pub/Sub into Firestore.
angular is the front-end web app that we wrote real quick (it's super basic) to display the results in real time.

How to detect users of my app who open it using an emulator on the PC

I have an app that has some unknown devices listed in the analytics portal I use.
I was wondering if Android and iOS have a method that I can call which tells me if the app has been downloaded and opened using an emulator?
I've thought of accessing the device's IMEI, but this is only for mobile phones and doesn't cover tablets. Any help would be greatly appreciated.
You can try filtering out the Connecting device's by their device's model number, name and id.
For that you first need your app to parse the data from the phone, and then send this data to your server while authentication.
The server checks the robots list and then authenticates the exceptions (genuine users).
NB: Nowadays emulators are updated, they are capable of spoofing a Device Name, Model and ID. So it's a hectic job to detect spoofer's.
Just a Mere Concept out of Thoughts, Might possibly work!
There are couple of methods out there. Android includes a built in method,but some of them can be maneuvered.
Android includes some system properties that keep such information. they can be accessed using the getprop utility and there are ways to get the problematically.
More specifically, the "ro.build.characteristics" will contain the word "emulator" when running on emulator.
Long story short: There are couple of libraries that are capable of doing this and are consider reliable.
Here is a good example:
https://github.com/framgia/android-emulator-detector
For iOS see this answer
As a side note. if you are concerned about having a safe environment to run your application, take a look at SafetyNet

Send messages from multiple smart watches to phone

I want to send messages from multiple smart watches to the smart phone(android) using message api. In the latest update of google play services, multiple smart watches can be connected to a smart phone using capability api. Since there are very less tutorials out there, I am finding it difficult to set this up. Could anyone please help me with the steps? Thanks in advance.
You can read the tutorial here for a good introduction and steps that you need to follow to set this up; first, your phone needs to advertise a certain capability that it has (say, it can transcribe voice messages) in an xml file. Then all other nodes on the wear network can query the framework for the nodes(s) that provide that capability and finally, each can send a message to those nodes. A good number of our samples on GitHub have been updated to use CapabilityApi (e.g. android-DataLayer sample) so you can look at them and see how things are set up. Finally, you can use WearCompanionLibrary that provides that functionality for you if you want or willing to use a library.

How to send data from android phone using bluetooth?

I have made an application, which shows the latitude and longitude of the device in textview. What I want to do is send that information over bluetooth, which would be received by another device and displayed. How do I go about adding this functionality to my bluetooth application?
I'm not sure what you have tried, yet this is always the best place to look at: link
The Android developer site gives you a nice description of everything and of coures, working examples.
Hope that helps.

Remote wipe data using Device Administrator Application+ android

I am working on android device policies, i am able to implement wipe data, force lock using sample given at below link
http://developer.android.com/guide/topics/admin/device-admin.html. I am not able understand how to wipe, force lock, change pwd Remotly from server. I spent lot of time in searching to get information but i am not suceed. Please give any information to implement policies Remotely.
Thanks in advance.
I've googled around a bit today as well, and I've come up with the following solution:
First, write a device administrator app, like the one referenced in the link you provided.
Then you will have to implement some technique so that you can push messages from a server to the android client. As of Android 2.2, you can use C2DM (Cloud to device messaging) provided by Google, I guess it isn't to hard to configure and get going. If you do not want to use this, there is the option to use some other kind of messaging framework, that allows you to push data, like XMPP or MQTT. The facebook messenger app for iOS uses MQTT, so that can't be all bad. It will however require more work setting up, than C2DM for example.
Finally you will have to push some kind of message from your server to the client via the method you chose and let your device administrator app listen to these messages and respond with the correct action, depending on message. So you can decide on your own what the messages will look like and contain.
There is also the option of using Exchange, but I do not know how that works.
So that is basically what I found out from my little research, I'd love to hear other ideas from someone else as well.

Categories

Resources