Android Archives

The following program will display an AlertDialog with a ListView of your String array or ArrayList:

Step1:

Create a string array inside your Activity class:

String [] fruits= { “Apple”, “Banana”, “Mango”,”Grapes”, “Orange”};

Step2:

Inside your onCreate() method add following:


//Don't forget to create a button to trigger the Alert Dialog

final AlertDialog.Builder builder = new AlertDialog.Builder(this);

myButton.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {

builder.setTitle("Fruits");
builder.setItems(fruits, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {

System.out.println("Selected Item:" + fruits[item]);

}
});
AlertDialog alert = builder.create();
alert.show();
}
});

Thats it!

Advanced Training in Android. Online Training also available at http://schogini.com/mobile-app-development-training .

Android Application Development Course Details are given below:

1. Eclipse: To Configure Eclipse to create, edit, build, and debug your Android applications and to manage project resources.

2. Android SDK: Installation, configure and use Android SDK Manager and Android Virtual Device Manager.

3. Activity Lifecycle: How activities are supposed to behave, onCreate(), onDestroy(), onPause(), onResume() and onSaveInstanceState()

4. GUI: Using XML for UI layout, Basic widgets, introductions to LinearLayout, RelativeLayout, and TableLayout.

5. Emulator: How to configure and use Android Virtual Device.

6. Resources: General theory of resources, Drawables, Values, XML and Offering multiple resource Sets

7. UI Widgets: Basic and Advanced Widget for UI Design.

8. Menu: Adding option menus, adding popup menus, showing dialogs

9. Media: Supported audio and video formats, simple audio and video playback, streaming audio and video.

10. Intents: Explicit Intents & Implicit intents.

11. Preferences and Files: Using shared preferences and simple reading and writing of files.

12. Notifications: Role of notifications, raising a notification and reacting to selected notifications.

13. Databases: Introducing SQLite, SQLiteOpenHelper and creating a database, Opening and closing a database, Working with cursors, Inserts, updates, and deletes

14. SMS, Email and Alarm: Sending an SMS and Email from your application, using AlarmManager for periodic actions and WakeLocks for work done while phone is asleep

15. Using Services: Broadcast Receivers, Services -Notifications and Toasts.

16. Maps: Adding a Google map, custom overlays with push-pins, Zoom controls and setting different map views.

17. Remote Server Communication: Use Http GET/POST for Remote Server communication via internet using AsyncTask.

 

In the latest Eclipse IDE for Android, app development, when we create a new project, we can see that another project file with the name “appcompat_v7”  will also get created. This is due to the ADT plugin, which will link the Eclipse IDE with the Android SDK.

 

This project file is created when you choose the minimum SDK version less than API 14. If your minimum SDK version is greater than or equal to API 14, then this file won’t be created. This file is created by the ADT plugin to make sure that the project works well on devices running with API versions less than API 14. It contains the support files and other files to link the project/application with older versions of Android.

 

So if you want to avoid the creation of this “appcompat_v7” file when you are creating a new project in Eclipse, then you will have to make sure that the minimum SDK you choose for new project is greater than or equal to API level 14.

What is Ems in Android?

EMS is a typography term, which is used as a unit to control the width of Android views. It is the width of the letter M in a given English font size. So ’n’ ems’s means ’n’ times the width of the letter M in the given font size. M is considered as the standard because M is e widest letter in English alphabet. You can set the ems property of a TextView as follows :

Inside the layout file

android:ems = ’14’

Or inside the activity/java file, its used as follows :

Object.setEms(14)

SONY DSC

You gotta hand it to Acer for giving its products self-explanatory names. The company just announced the Aspire Switch 10, and it’s pretty much exactly what it sounds like. Which is to say, it’s a 10.1-inch Windows device that switches (get it?) from one mode to another. In particular, it’s a tablet with a magnetic keyboard dock, allowing you to use it as a tablet, a clamshell laptop, or in one of two hybrid modes: “Display” (with the screen facing away) and “Tent” (upside down). In practice, then, it’s kind of a cross between Lenovo’s Yoga series and Lenovo’s reversible ThinkPad Helix tablet. The big difference: it has a much lower-power processor than the Helix, and doesn’t accept pen input. Even so, we suspect Lenovo’s laughing somewhere.

Though the dock has a pair of spiky anchors to guide the tablet in, it’s mainly magnets holding the two pieces together. In my brief hands-on with it, I was surprised to find that, despite the otherwise cheap build quality, the tablet and dock do indeed click together seamlessly, with little effort required on the part of the user. At the same time, they’re easy enough to pull apart when need be. As for the dock, it brings a full-sized USB port, microSD slot and a miniature HDMI port, and there will also be another dock with a built-in hard drive — you know, in case the tablet’s built-in 32GB/64GB of storage isn’t enough.

Courtesy – Engadget

AcerLogoMetallic

Blink and you would’ve missed it: in the middle of a big press event here in New York, Acer very quickly (and very casually) revealed it’s going to be entering the smartwatch space later this year. The Liquid Leap, as it’s known, is a narrow, 17mm-wide band, designed specifically to appeal to both men and women (not naming names, but ahem, Pebble). According to an Acer rep, the touchscreen wearable blends both fitness and more “traditional” smartwatch features (think: notifications). Even then, it’s unclear whether those fitness features will be nominal, or if this will be a veritable Gear Fit competitor that tries to do well at both. What we do know is that this will initially be sold as part of a bundle with Acer’s forthcoming 5-inch Liquid Jade smartphone (no details there, sorry). Additionally, the Acer rep we spoke to indicated the watch would arrive in a “test market” first — likely Asia. Until it launches, then, your guess about the final product is as good as ours.

Courtesy – Engadget

glass-earbud

Google isn’t done upgrading Glass this month just because the KitKat update is out the door. It’s rolling out another release this week that should be huge for frequent callers and photographers. You’ll no longer miss a phone call just because Glass took control of the audio; the eyewear is now smart enough to route sound to your handset when you’re using it to hold a conversation. It’ll also be possible to back up photos and videos when away from WiFi, and you can clear those shots from your timeline with one swipe when you’re done. There should be more voice commands to accommodate third-party apps, as well. It’s not clear exactly when the update hits, but it should give the surge of new Glass owners one more thing to look forward to.

Courtesy – Engadget

gopro

GoPro’s smartphone apps have been a useful addition to its popular action cams for quite some time, and now the Android version sees a nice update. First, and most importantly, the app now automatically connects to your camera’s WiFi signal on launch, nixing a visit to the settings menu as your first stop. Sharing is easier as well, as those captured stills and videos can now be beamed to Instagram, Facebook, YouTube and other social repositories directly from your mobile device. There’s also an updated UI for those wielding version 4.0 or later of Google’s mobile OS and the ability to have the app set the curated Photo of the Day as your wallpaper. Haven’t been alerted to version 2.4 yet? Well, jump down to the source link to nab the download now.

Courtesy – Engadget

List of Basic Event Listeners in Android

Event listeners are the objects which receives events when it occurs. Here are a list of basic event listeners in Android.

 

onClickListener() – will use onClick() event handler method to handle such events.

onLongClickListener() – will use onLongClick() event handler method to handle such events.

onFocusChangeListener() – will use onFocusChange() event handler method to handle such events.

onKeyListener() – will use onKey() event handler method to handle such events.

onTouchListener() – will use onTouch() event handler method to handle such events.

onMenuItemClickListener() – will use onMenuItemClick() event handler method to handle such events.

List of Basic Event Handlers in Android

Event handlers are the methods called by even listeners when an event is happening once that event is registered. Here are a list of basic event handlers in Android.

 

onClick()

onLongClick()

onFocusChange()

onKey()

onTouch()

onMenuItemClick()

Page 1 of 6812345...102030...Last »
We Can Build Your App for You. Lets Get Started !