Showing posts with label Android Market. Show all posts

Using Android to develop healthcare applications and devices

Believe or not, most makers of DIY Gadgets are very greenpeace-compatible because many DIY projects recycle garbage to create something useful. Healthcare is certainly one of the many topics we shouldn't ignore, not only because of the ethical nature that gears to what a DIYer would love, but also because it involves many external hardware devices, great gadgets for curing illness and saving lives.

Since Android Ice Cream Sandwich (Android 4.0, API 14), we can develop Android applications for Bluetooth Health devices.

The official Android Developer site indicates that the BluetoothHealth API allows communication with devices that implement the Bluetooth Health Profile (HDP).

What is that? What can we do?

Let's see what a Bluetooth profile is: it is a wireless interface specification for Bluetooth-based communication between devices. In order to use Bluetooth technology, a device must be compatible with the subset of Bluetooth profiles necessary to use the desired services. A Bluetooth profile resides on top of the Bluetooth Core Specification and (optionally) additional protocols. While the profile may use certain features of the core specification, specific versions of profiles are rarely tied to specific versions of the core specification.

Bluetooth headset users are very familiar with the Advanced Audio Distribution Profile (A2DP). This profile defines how high quality audio (stereo or mono) can be streamed from one device to another over a Bluetooth connection. For example, music can be streamed from a mobile phone, to a wireless headset, hearing aid & cochlear implant streamer, or car audio or from a laptop/desktop to a wireless headset.

Health Device Profile (HDP) is also a traditional Bluetooth profile. It is designed to facilitate transmission and reception of Medical Device data. The APIs of this layer interact with the lower level Multi-Channel Adaptation Protocol (MCAP layer), but also perform SDP behavior to connect to remote HDP devices. It also makes use of the Device ID Profile (DIP).

Here are some documents: 
http://www.ars2000.com/Bluetooth_HDP.pdf
http://www.ars2000.com/Health-Device-Whitepaper.pdf

Ok, too much new information for non bluetooth-experts. Let's see some examples. These videos are really old where you can find some ancient phones. but you can imagine with today's beyond-smart-phones, everything can be greatly refined.

Video links:
http://www.youtube.com/watch?v=ERafau_GKxs
http://www.youtube.com/watch?v=oXFUXIF5Spo
http://www.youtube.com/watch?v=Vrji-kC1rk4


How to use BluetoothHealth API in Android?

It is fairly easy, just create a BluetoothHealth object. BluetoothHealth is a proxy object for controlling the Bluetooth Service via IPC. If you don't know what IPC is, check it out here.

How to connect to an external health device which is acting in the source role:

  • Use getProfileProxy(Context, BluetoothProfile.ServiceListener, int) to get the BluetoothHealth proxy object. 
  • Create an BluetoothHealth callback and call registerSinkAppConfiguration(String, int, BluetoothHealthCallback) to register an application configuration 
  • Pair with the remote device. This currently needs to be done manually from Bluetooth Settings 
  • Connect to a health device using connectChannelToSource(BluetoothDevice, BluetoothHealthAppConfiguration). Some devices will connect the channel automatically. The BluetoothHealth callback will inform the application of channel state change. 
  • Use the file descriptor provided with a connected channel to read and write data to the health channel. 
  • The received data needs to be interpreted using a health manager which implements the IEEE 11073-xxxxx specifications. 
  • When done, close the health channel by calling disconnectChannel(BluetoothDevice, BluetoothHealthAppConfiguration, int) and unregister the application configuration calling unregisterAppConfiguration(BluetoothHealthAppConfiguration) 

PS: There multiple BLE Health related profiles, the profile that Android uses is a very traditional one, which is not to be confused with similar Bluetooth Low Energy (BLE) profiles such as Health Thermometer and Hear Rate Monitor.

Now that Android is starting to provide official APIs, and that wireless integration with Healthcare has always been a great topic, it is worth getting started.

Imagine when you combine the Android BluetoothHealth API with Google Health APIs, that can create something really neat.

The Java Health Client APIs are documented at:

http://code.google.com/apis/health/docs/2.0/developers_guide_java.html

You can use "gdata" APIs on Android:

http://code.google.com/p/gdata-java-client/downloads/list

For authentication, there's a section in the Health API docs on choosing the appropriate mechanism:

http://code.google.com/apis/health/docs/2.0/developers_guide_protocol.html#Authenticating

One more thing: if you are not very interested in Bluetooth, start with something easy but really usesful, with your imagination.

Last weekend I made this application, pure software, aiming at helping people to better sleep without signal radiation and data consumption. It is called "Auto Signal Off When I Sleep", available in Android Market here.



That's way simple! You'd say. Well, it is a useful healthcare application, ain't it? Start your own healthcare applications now.



Endless ways to use Android for creating hardware-enriched intelligent systems

It might sound exaggerating that I use the word "endless" because most applications in Android Market don't give us such an impression. In our daily life we don't use our smartphones to interact with other machines pretty often. 

I'd say, it is just a start.

AR.Drone players may say: 

"Isn't the phone a cool remote-control, a console that is fully programmable and you can take everywhere?"

Arduino lovers or robotics/electronics system designers may say: 

"Well, more than a console. We love reading beautiful data graphs on Android's large screen. That's a perfect portable oscilloscope. Of course, we can take advantage of Android's great processor to perform complex computing. We can also use an USB cable to integrate it as an on-board "brain".

RC model makers say, "Sure we love the brain mode to have Android integrated on-board", as the DIY Drone's PhoneDrone board suggests:

"With Android you can switch between RC control and Android control or mix the two. You steer your vehicle via RC, but an Android phone does the actual control sending M2M commands to the on-board IMU. On a car, that would allow every turn to be a high-speed controlled drift, for instance.

Or, with a UAV, you might have the Android phone doing high-level image processing and object tracking, sending mission commands to an autopilot board. You might also want to use the phone's long-distance wireless instead of an Xbee for two-way telemetry.  This can either replace the original control board if you've got equivalent code running on Android, or compliment it with the Android device doing image processing or long-distance wireless communications."

OK, that's a lot of messy information when I put all the remarks here. It took me a while (actually two years) to observe, to test and to conclude what people really need Android to do in such hardware-enriched intelligent systems.

I've finally made a list of all possible outputs from Android and what we can input to Android:

1. Possible outputs from Android:

1.1 Sending high-level human-readable commands via user-interface by using the phone's built-in hardware

There is a big screen to display images and text, a speaker to perform text-to-speech or play music, a vibrator to give some notifications, etc.

This is what most applications in Android Market do. 

1.2 Sending high-level commands to tell one or multiple external devices what tasks to perform and controlling the actions of each external device

Examples:

1.2.1 All the remote control applications using WiFi or bluetooth. 

High-tech toys are pretty popular now, like this Sphero Toy Ball controlled by iPhone and Android:



Of course we have some more serious use-cases: e.g.: using Android to replace your PC's keyboard and mouse.  I use RemoteDroid personally in bed: 



1.2.2 Autonomous control system where Android is integrated on-board and outputs the commands automatically like this:




And this open-source project called Droid-Copter:


             
1.3 Sending built-in sensor data  (GPS, gyroscope, accelerometer, digital compass , proximity sensor, etc.) from the phone to one or multiple external devices

Examples: 

GPS tethering: search "GPS tether" in Android Market and you will get many applications.

In DIY quadcopter, we can use Android to replace completely the MCU control board like ArduPilot. In that way we will use Android's gyroscope and compass. I am confident enough that on DIY Drones some intelligent guys can finally make a UAV with their on-board Android phone in the near future, like this unfinished project:



But let's see a prototype from the Cellbots open source project that I really like. The Arduino on the robot reads the phone's digital compass output to adjust orientations in an autonomous way, you get the idea:





2. Possible inputs to Android:

2.1 Receiving human commands via user-interface input by using the phone's built-in hardware

We have:
  • a touch screen for getting user's command,
  • a camera for "recording" the optical environment and some image processing to recognize a face,
  • a microphone to get what people say and may perform voice recognition like "speech-to-text", etc.

This is what most applications in Android Market do. 

2.2 Receiving high-level commands from external devices that can be processed and figuring out what to do next

Examples:
  • Autonomous SMS chat between two phones
  • Various Internet protocols between Android and cloud. In Google IO 2011 there is more about Cloud Robotics, ROS Java and Android:


3. Receiving low-level sensor data from one or multiple external devices to get processed by the phone

This usually requires Bluetooth, WiFi, UART or serial connector to realize the sensor reading.  

Examples can be using an external GPS to replace the built-in GPS to provide accuracy, or using temperature sensors to be displayed on Android, etc.  

And today we just received this cool project from Mr. Al Linke, who proudly presents his cute funny artistic masterpiece, the Android Breathalyser:


Mr. Al Linke said that as a casual programmer, he spent just 3 nights to realize this, which shows the ease of using the IOIO board for Android. 

Whoever wants to replicate this project within 2 nights (if you want a challenge:)), here is the main parts list:


2. LiPo rider: the LiPo rider takes the 3.7V from the LiPo battery and converts to +5V that the IOIO needs on its Vin. Plus the LiPo rider is also a charger so the whole thing becomes a self contained rechargeable unit.


4. And of course the magical IOIO board.


All in all:

There are endless ways to use Android for creating hardware-enriched intelligent systems. We hope that before designing your new system, you take a serious glance at what Android can provide and which inputs/outputs are capable to meet your needs, in order to keep the project simple and powerful. A good selection and combination of those Android inputs and outputs can be the key to success.


Enable and configure Android WiFi tethering hotspot AP without root


We have just made this  "1-Click WiFi Tether No Root" application, which allows you to transform your Android phone into a wireless hotspot. 


1. It easily and quickly enables WiFi Tethering hotspot AP in 1-Click.


2. It does NOT require root access.


3. It works on MOST devices with Android 2.3 or above, with MOST operators. 


4. If Wi-Fi tethering is not yet possibile with your device because of some device or carrier restrictions, we have prepared USB or bluetooth tethering as your alternative choices.


The app has been downloaded 300,000 times. You can get it for free in Google Play Store:
https://play.google.com/store/apps/details?id=com.diyphonegadgets.wifihotspot




Use it to get Internet connection on Windows, Mac, another phone or tablet, Ubuntu, Wii, PS3 and a lot more, everywhere. One of our users use it in the woods and dance with xBox live! What a wonderful portable party!


Perhaps the world's lightest, cleanest and fastest app for launching WiFi hotspot. We have reduced the app size to almost nothing.


If you want a secured connection with password protection, or be able to customize your hotspot AP name, please download the pro version here:
https://play.google.com/store/apps/details?id=com.diyphonegadgets.wifihotspot.pro




Or search "1-Click WiFi Tether Pro" in the store.


Important: If this works on your unrooted device, please don't accept system updates, otherwise this application will be banned and will not be compatible with your new system any more. The only solution then should be to root your beloved phone.



Its purpose is to avoid and replace the standard manual configuration, which requires at least 5 clicks everytime you need to start WiFi tethering, which might also ask you to enter some text to configure the WiFi hotspot.

If you use this application, you only need 1 click without entering anything.

We have tested it mainly with European carriers. It works on most devices with Android 2.2 or higher.
Whether it works is really carrier or device specific. Please do not give it a bad rating. Thanks:)

Possible reasons if it doesn't work :

1. Your operator doesn't support WiFi tethering and blocks it on purpose.
2. Your phone's 3G connection is too weak.
3. Your system ROM had been modified by the manufacturer
4. You don't have a data plan on your SIM card

Here are some user reviews:

★★★★★ ScottyB Apr 9 Galaxy Nexus
5 stars for first try! So simple, literally 1-click.

★★★★★ Patti Feb 29 Galaxy S
Great for those who don't want to root

★★★★★ Dana Jun 9 LG Ally
Love this app! I get internet access anywhere on any device.

★★★★★ Pauline Jul 1 ZTE Score
This is the only wifi hotspot i found that works, runs smoothly no problem :)

★★★★★ Jacob Apr 23 LG Ally
Best! Perfect! Really glad it's so small too!

★★★★★ David Dec 10 LG Ally
Wow! Just minutes after I downloaded this, I was able to tether my phone to my Xbox & connect to Xbox Live while in a cabin in the middle of the woods!

★★★★★ Alex Jan 22 Moto Atrix
Have been trying to find a tether app for non rooted devices. Finally found one that works great. I have a Motorola with Gingerbread 2.3.4 with Vodafone carrier in Spain. Worked perfect on first try.

★★★★★ Massimo Jan 22 Galaxy Nexus
Fantastiko. Asks only wifi permission and don't have to give away my contacts, my identity, my wife, the colour of my undies etc

★★★★★ Justin Dec 8 Moto Droid X2
Used it to link 2 phones to play games using wifi and it works great

★★★★★ Shelby Jan 25 Huawei U8800-51
Perfect and works flawlessly with my iPad!

★★★★★ Achint Jun 24 Galaxy S2
Simple! I am not the types who rate an app but this is really worth it.

★★★★★ Wayne Mar 10 Huawei Att Impulse
I've tried several ways of tether and have failed each and every time with this wonderful app I've been able to tether my laptop wii and xbox360 successfuly great job

★★★★★ prashant Mar 9 LG Pecan
works with my psp and ps3 no problem at all especially easy to use. i tried every app in the market none worked but this one worked pretty awesome love it

★★★★★ Daniel Jun 16, 2012 Moto Photon 4G
Tried this wifi app on my Non-Rooted phone, had my PS Vita Hooked up using my Sprint 4g service. Deff worth it

★★★★★ YaqaKallah Jun 13, 2012 Huawei Ascend II
This has been a lifesaver in our home. It successfully connected our Laptops, Notebook & e-Book every single time instantly! Thanx DIY!

★★★★★ joe May 22, 2012 Moto Triumph
:)This app works the best out of any tether i have tried. It connects me the fastest and gives great speed. 6 stars, lol

Free download: https://play.google.com/store/apps/details?id=com.diyphonegadgets.wifihotspot