background preloader

Android

Facebook Twitter

Java: how can i set a class's field by a field name that stored in a variable. Multithreading For Performance. [This post is by Gilles Debunne, an engineer in the Android group who loves to get multitasked. — Tim Bray] A good practice in creating responsive applications is to make sure your main UI thread does the minimum amount of work.

Multithreading For Performance

Any potentially long task that may hang your application should be handled in a different thread. Typical examples of such tasks are network operations, which involve unpredictable delays. Users will tolerate some pauses, especially if you provide feedback that something is in progress, but a frozen application gives them no clue. In this article, we will create a simple image downloader that illustrates this pattern. An Image downloader Downloading an image from the web is fairly simple, using the HTTP-related classes provided by the framework. Static Bitmap downloadBitmap(String url) { final AndroidHttpClient client = AndroidHttpClient.newInstance("Android"); final HttpGet getRequest = new HttpGet(url);

Network

Customizing Android ListView Items with Custom ArrayAdapter Tutorial in Category Android at EzzyLearning.com. How to add onItemClick event based on Custom array adapter above Posted by kadek iwan on 27 Aug 2011 You can use listView1.setOnItemClickListener event.

Customizing Android ListView Items with Custom ArrayAdapter Tutorial in Category Android at EzzyLearning.com

See my following tutorial for an example. Posted by Waqas Anwar on 27 Aug 2011 Marvelous work... keep it up.. Posted by ajay on 31 Aug 2011 Your solution assumes 5 entries cloudy, showers, stormy etc... Posted by Mark Manickaraj on 20 Sep 2011 You can fill weather data variable from the data coming from any of your method or service method.Weather weather_data[] = youservice.GetWeatherData(); Posted by Waqas Anwar on 21 Sep 2011 When you add enough items to scroll the scroll is laggy.

Posted by Mark Manickaraj on 22 Sep 2011 Hey thanks. Posted by ruchi on 20 Nov 2011 hie , there seem a problem with ur code ..works slow and list view takes time to load while scrolling ..can u help ?? Rich-Style Formatting of an Android TextView - ChrisUmbel.com. Even a developer-friendly mobile platform like Android can have a developer feeling a little lost when trying to perform simple tasks when you're unfamiliar with the platform.

Rich-Style Formatting of an Android TextView - ChrisUmbel.com

One of these simple, however poorly documented, tasks is rich-style text formatting within a TextView. SpannableString In the end this isn't limited to formatting. It also allows the developer to add behaviors to spans such as reacting to click events. Example. Android – Simple XML DOM Parser Example for Reading Response From InputStream. Hi, I am trying to use simple XML DOM Parser for my HTTP response.

Android – Simple XML DOM Parser Example for Reading Response From InputStream

Basically I am calling .Net webservice and I need to parse response. Let me also cover calling the .Net webservice. Webservice can be called/consumed by may way. For Example: Use SOAP call, HTTP Get method, HTTP Post method and many more.. I have one Web service method with Post call structure: Android XML Parsing Tutorial. Using SQLite on Android. Android App Patterns. Design. Android Button background image pressed/highlighted and disabled states without using multiple images.

In Android, if you provide custom background images for buttons, you will lose the pressed and disabled image effects.

Android Button background image pressed/highlighted and disabled states without using multiple images

The common way to fix that is to provide additional images for those states. I’m lazy and I find this inconvenient especially during the prototyping phase of app development. To use this, just replace your original button declarations like this:

SDKs

App Widget Design Guidelines. New Guides for App Designers!

App Widget Design Guidelines

Check out the new documents for designers at Android Design. App widgets (sometimes just "widgets") are a feature introduced in Android 1.5 and vastly improved in Android 3.0 and 3.1. A widget can display an application's most timely or otherwise relevant information at a glance, on a user's Home screen. The standard Android system image includes several widgets, including a widget for the Analog Clock, Music, and other applications. Figure 1. This document describes how to design a widget so that it fits graphically with other widgets and with the other elements of the Android Home screen such as launcher icons and shortcuts.

For information about developing widgets, see the App Widgets section of the Developer's Guide. Standard Widget Anatomy Typical Android app widgets have three main components: A bounding box, a frame, and the widget's graphical controls and other elements. Widget. The widget package contains (mostly visual) UI elements to use on your Application screen.

widget

You can also design your own. To create your own widget, extend View or a subclass. To use your widget in layout XML, there are two additional files for you to create. Here is a list of files you'll need to create to implement a custom widget: Java implementation file - This is the file that implements the behavior of the widget. Simple Android application from scratch in IntelliJ IDEA 11.0 - IntelliJ-Wiki. From IntelliJ-Wiki IntelliJ IDEA supports development of applications to be executed on mobile phones that run under the Android operating system.

Simple Android application from scratch in IntelliJ IDEA 11.0 - IntelliJ-Wiki

Besides general coding assistance, the IDE lets you test Android applications on user-configured emulators of physical devices. IntelliJ IDEA helps: