Tuesday, December 7, 2010

Android intent for SMS

//this snip will launch the SMS application without the need to ask for the SMS Permission in Manifest.
String phonehere = 443xxxxxxx; //place phone number here
//initialize

private void sendsms() {
Uri smsUri = Uri.parse("tel:" + phonehere );
Intent intent = new Intent(Intent.ACTION_VIEW, smsUri);
intent.putExtra("address", phonehere);
intent.putExtra("sms_body", bookfrommap);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
}

Saturday, December 4, 2010

Android Data Logging with an Arduino


This is an Android data logger using a remote Arduino with Ethernet Shield attached. Data logging with a standalone Arduino has limitations such as lack of RTC and lack of multi-threading(needed to access data and log simultaneously). So a neat solution is to do the logging on a device that can multi-thread while leaving the analog port reading to the Arduino. The Arduino listens for a client to connect, and upon the client request, sends a reply back to the android device with the sensor data. The image on the right shows my sensors (s0,s1,s2) and the temperatures. The sensors are linear active thermistors MCP9701.