How to open wifi settings in android?

How to open wifi settings in android?

In today’s tutorial I will show you how to open the wifisettings in android programatically. This code comes handy when the user have not enabled the wifi and you want the user to enable it for your application to work. Here is the code for that. 1 2 3 4 5 6 7 8 9 10 1

[ read more ]

Sort directory/file in alphabetical order ignore case

Sort directory/file in alphabetical order ignore case

Last exercise of "File Explorer" list file/directory without order. We can implement Comparator<? super File> to sort the directory/file in alphabetical order. We can also convert the file name to lower case before comparing, such that the array will be sorted in alphabetical order ignore case

[ read more ]

Implement a simple File Explorer in Android

Implement a simple File Explorer in Android

- First of all, as a user app, I think it should not access the root "/" directly. So I assign root to Environment.getExternalStorageDirectory(), it's the Android external storage directory. - Secondly, if a file/directory is hidden or un-readable, it will not be display. Create /res/layout/row.

[ read more ]

Custom ArrayAdapter, with different icons.

Custom ArrayAdapter, with different icons.

In the last exercises "A simple ListView, extends ListActivity", "ListView, with icon" and "Implement onListItemClick() of ListActivity", all use the build-in ArrayAdapter with standard layout in each row. All row have the same icon. In this article, a custom ArrayAdapter will be created. The met

[ read more ]

Implement onListItemClick() of ListActivity

Implement onListItemClick() of ListActivity

Modify the java code of the last exercise "ListView, with icon" to add listener of onListItemClick() AndroidList.java package com.exercise.AndroidList; import android.app.ListActivity; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import andro

[ read more ]

ListView, with icon

ListView, with icon

ListView in simplest form with plain text only. This exercise describe how to add a icon in ListView. create a new file in /res/layout/row.xml, to setup our layout on each row. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/an

[ read more ]

A simple ListView, extends ListActivity

A simple ListView, extends ListActivity

It's the simplest form of ListView, extends ListActivity. The list is displayed as a single line of plain text, using the simple Android built-in layout "android.R.layout.simple_list_item_1". package com.exercise.AndroidList; import android.app.ListActivity; import android.os.Bundle; impor

[ read more ]

Using convertView in getView() to make ListView efficient

Using convertView in getView() to make ListView efficient

convertView - The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view. If the convertView is null, we have to run the co

[ read more ]

Load ImageView with bitmap from internet

Load ImageView with bitmap from internet

It's a simple way to load ImageView with a bitmap from internet, via http connection. In order to load something from internet, the AndroidManifest.xml have to be modified to grand permission for internet access. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http:

[ read more ]

PhoneGap PayPal-Plugin

PhoneGap PayPal-Plugin

by Paul Beusterien, Mobile Developer Solutions, Carl Stehle, Appception Inc. and Tomaz Kregar, Bucka IT Adding the Plugin to your project Using this plugin requires Android Cordova (PhoneGap) and the PayPal Mobile Payments Library. The PayPal Mobile Payments Library can be downloaded here.

[ read more ]