Thursday, November 17, 2011

Using Http Post to fill a form with HttpClient.

public StringBuilder post(String url) {                 HttpClient httpclient = new DefaultHttpClient();                 HttpPost httppost = new HttpPost(url);                 // Add your data (Var name, Var value)                 List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);                 httppost.getParams().setParameter(                 CoreProtocolPNames.USE_EXPECT_CONTINUE, Boolean.FALSE);                 nameValuePairs.add(new BasicNameValuePair("ageDay", "30"));                 nameValuePairs.add(new BasicNameValuePair("ageYear", "1959"));                 httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));                 // Execute HTTP Post Request                 HttpResponse response = httpclient.execute(httppost);                 // Saves response                 String line = "";                 StringBuilder result = new StringBuilder();                 BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));                 while ((line = rd.readLine()) != null) {                         result.append(line);                 }                 rd.close();                 return result;                 }

How to invert bitmap color

public static Bitmap invert(Bitmap src) {                 Bitmap output = Bitmap.createBitmap(src.getWidth(), src.getHeight(), src.getConfig());                 int A, R, G, B;                 int pixelColor;                 int height = src.getHeight();                 int width = src.getWidth();             for (int y = 0; y < height; y++) {                 for (int x = 0; x < width; x++) {                     pixelColor = src.getPixel(x, y);                     A = Color.alpha(pixelColor);                                         R = 255 -;                     G = 255 -;                     B = 255 -;                                         output.setPixel(x, y, Color.argb(A, R, G, B));                 }             }             return output;         }  

Wednesday, May 25, 2011

Popup SMS - Android Aplication

Popup SMS brings you cool UI, fast and convenient SMS experience. Popup SMS provides a convenient popup dialog when a message is received that allows you to quickly read and reply or forward or call to messages. Quickly read and reply or forward or call to SMS messages from a convenient popup window. It also provides in-depth customization of message notifications including contact specific sound, vibrate and LED settings. Popup SMS is a tiny application, which is receiving SMS messages as a notification with popup. Have a useful experience with Message Popup. Similar to the SMS Popup app - but is faster, looks better, and is a pleasure to use.

Full feature list:
- Convenient popup window on incoming message
- Quickly reply, delete, forward, call or close the message
- Customize notifications including sound, vibrate pattern, LED color (if available).
- Also customize notifications for individual contacts
- Setup notification reminders (repeating notifications if you miss the first one)
- Optional privacy mode to hide sender name and message contents

Developed by :
-        Mitul Nakum
-        Sanjay Patel
-        Pravin Dodia

Wednesday, May 11, 2011

Android 3.1 Platform : Whats new for Developers... ??

The Android 3.1 platform adds refinements and new capabilities that developers can build on, to create powerful and engaging application experiences on tablets and other large-screen devices.
Open Accessory API for rich interaction with peripherals
Android 3.1 introduces a new API for integrating hardware accessories with applications running on the platform. The API provides a way to interact across a wide range of peripherals, from robotics controllers to musical equipment, exercise bicycles, and more.
The API is based on a new USB (Universal Serial Bus) stack and services that are built into the platform. The platform provides services for discovering and identifying connected hardware, as well as for notifying interested applications that the hardware is available.
When a user plugs in a USB accessory, the platform receives identifying information such as product name, accessory type, manufacturer, and version. The platform sets up communication with the accessory and uses its information to notify and launch a targeted app, if one is available. Optionally, an accessory can provide a URL that lets users find and download an app that works with the accessory. These discovery features make first-time setup easier for the user and ensure that an appropriate application is available for interacting with the connected hardware.
For application developers and accessory manufacturers, accessory mode offers many new ways to engage users and build powerful interaction experiences with connected hardware.
To learn more about how to develop applications that interact with accessories, see the USB Accessory documentation.
USB host API
Android 3.1 provides built-in platform support for USB host mode and exposes an API that lets applications manage connected peripherals. On devices that support host mode, applications can use the API to identify and communicate with connected devices such as audio devices. input devices, communications devices, hubs, cameras, and more.
To learn more about how to develop applications that interact with USB devices, see the USB Host documentation.
Input from mice, joysticks, and gamepads
Android 3.1 extends the input event system to support a variety of new input sources and motion events, across all views and windows. Developers can build on these capabilities to let users interact with their applications using mice, trackballs, joysticks, gamepads, and other devices, in addition to keyboards and touchscreens.
For mouse and trackball input, the platform supports two new motion event actions: scroll (horizontal or vertical) such as from a scrollwheel; and hover, which reports the location of the mouse when no buttons are pressed. Applications can handle these events in any way needed.
For joysticks and gamepads, the platform provides a large number of motion axes that applications can use from a given input source, such as X, Y, Hat X, Hat Y, rotation, throttle, pressure, size, touch, tool, orientation, and others. Developers can also define custom axes if needed, to capture motion in additional ways. The platform provides motion events to applications as a batch, and applications can query the details of the movements included in the batch, for more efficient and precise handling of events.
Applications can query for the list of connected input devices and the motion ranges (axes) supported by each device. Applications can also handle multiple input and motion events from a single input device. For example, an application can use mouse and joystick and mouse event sources from a single input device.
Resizable Home screen widgets
Developers can now create Home screen widgets that users can resize horizontally, vertically, or both. By simply adding an attribute to the declaration of a widget, the widget becomes resizable horizontally, vertically, or both. This lets users customize the display of the widget content and display more of it on their Home screens.
MTP API for integrating with external cameras
In Android 3.1, a new MTP (Media Transfer Protocol) API lets developers write apps that interact directly with connected cameras and other PTP devices. The new API makes it easy for applications to receive notifications when devices are attached and removed, manage files and storage on those devices, and transfer files and metadata to and from them. The MTP API implements the PTP (Picture Transfer Protocol) subset of the MTP specification.
RTP API, for control over audio streaming sessions
Android 3.1 exposes an API to its built-in RTP (Real-time Transport Protocol) stack, which applications can use to directly manage on-demand or interactive data streaming. In particular, apps that provide VOIP, push-to-talk, conferencing, and audio streaming can use the API to initiate sessions and transmit or receive data streams over any available network.
Performance optimizations
Android 3.1 includes a variety of performance optimizations that help make applications faster and more responsive. Some of the optimizations include:
  • A new LRU cache class lets applications benefit from efficient caching. Applications can use the class to reduce the time spent computing or downloading data from the network, while maintaining a sensible memory footprint for the cached data.
  • The UI framework now supports partial invalidates in hardware-accelerated Views, which makes drawing operations in those Views more efficient.
  • A new graphics method, setHasAlpha(), allows apps to hint that a given bitmap is opaque. This provides an extra performance boost for some types of blits and is especially useful for applications that use ARGB_8888 bitmaps.

Wednesday, April 20, 2011

Social Texts

Publish your sms directly to Facebook wall

Friday, March 18, 2011

Mount NTFS partition or external drive with Read/Write permissions on MAC OS X

........ and the answer is NTFS 3G ........

NTFS-3G for Mac OS X is a software project designed to bring NTFS read/write support to Mac OS X along with additional advanced features.

It is based on NTFS-3G, the leading open source NTFS driver that is ported into numerous platforms, but also includes other software projects to build a complete toolset for managing NTFS volumes.

NTFS-3G itself is included in hundreds of Linux distributions; for example Fedora, Mandriva, openSUSE and Ubuntu use NTFS-3G as the default NTFS driver. Development has been ongoing since 2006.

Download NTFS 3G

Version 2010.10.2: Release notes were unavailable when this listing was updated.
  • PPC / Intel
  • Mac OS X 10.4 or later (the purely 64-bit kernel used by Xserves running Mac OS X 10.6 is not supported)
A freely and commercially available and supported read/write NTFS driver for Linux, FreeBSD, Mac OS X, NetBSD, Solaris, Haiku, and other operating systems. It provides safe and fast handling of the Windows XP, Windows Server 2003, Windows 2000, Windows Vista, Windows Server 2008 and Windows 7 file systems.

NTFS-3G develops, quality tests and supports a trustable, feature rich and high performance solution for hardware platforms and operating systems whose users need to reliably interoperate with NTFS.

The driver is used by millions of computers, consumer electronics devices for reliable data exchange, and referenced in more than 30 computer books. Please see our test methods and testimonials on the driver quality page at

Wednesday, March 16, 2011

Check if internet is available : Android

This function will return true if you can access the internet (or false if you can't). You can change the parameter being return when roaming (read the comments).
* @return boolean return true if the application can access the internet
private boolean haveInternet() {
NetworkInfo info = ((ConnectivityManager)getSystemService
if (info == null || !info.isConnected()) {
return false;
if (info.isRoaming()) {
// here is the roaming option you can change it if you want to
// disable internet while roaming, just return false
return true;
return true;

In your manifest file add at least:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />