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 ]
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 ]
- 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 ]
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 ]
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 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 ]
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 ]
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 ]
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 ]
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 ]