Android
文章平均质量分 55
devil8389
这个作者很懒,什么都没留下…
展开
-
Android simple values
android simple values原创 2010-05-31 16:53:00 · 350 阅读 · 0 评论 -
Maps,Geocoding,and Location-Based Services
SELECTING A LOCATION PROVIDERTo get an instance of a specific provider, call getProvider, passing in the name:String providerName = LocationManager.GPS_PROVIDER;LocationProvider gpsProvider;gpsProvider = locationManager.getProvider(providerName);Finding the原创 2010-06-04 17:03:00 · 855 阅读 · 0 评论 -
WORKING WITH SQLite DATABASES
Skeleton code for a standard database adapter implementationimport android.content.Context;import android.database.*;import android.database.sqlite.*;import android.database.sqlite.SQLiteDatabase.CursorFactory;import android.util.Log;public class MyDBAdapt原创 2010-06-03 17:17:00 · 482 阅读 · 1 评论 -
CREATING A NEW CONTENT PROVIDER
Creating a new Content Providerimport android.content.*;import android.database.Cursor;import android.net.Uri;import android.database.SQLException;public class MyProvider extends ContentProvider {@Overridepublic boolean onCreate() {// TODO Construct the un原创 2010-06-03 17:50:00 · 843 阅读 · 1 评论 -
Files and prefernces
<br />Using the SharedPreferences class you can create named maps of key/value pairs within your<br />application that can be shared among application components running in the same application<br />context.<br /> <br /> call getSharedPreferences on the ap原创 2010-06-02 15:07:00 · 677 阅读 · 0 评论 -
USING INTERNET RESOURCES
<br />There are a number of benefits to creating thick- and thin-client native applications rather than relying<br />on entirely web-based solutions:<br />Bandwidth Caching Native features<br /> <br />Mobile Internet GPRS, EDGE, and 3G Internet access is原创 2010-06-02 11:19:00 · 436 阅读 · 0 评论 -
INTRODUCING ADAPTERS
<br /> <br />Adapters are bridging classes that bind data to Views (such as List Views) used in the user interface.<br /> <br />Some Native Adapters<br /><br />ArrayAdapter The Array Adapter uses generics to bind an Adapter View to an array of<br />objects原创 2010-06-02 11:08:00 · 409 阅读 · 0 评论 -
使用Intent filter 匹配相应的Activity or services
<br />1. action 用action来匹配<br />2. action 相同时用category filter<br />3. 前两者都相同时用 data来filter <br /> <br />例如:<br /><activity android:name=".abc" android:label="@string/app_name"><br /><intent-filter><br /><action android:name="android.intent.action.PICK"></原创 2010-06-02 10:02:00 · 423 阅读 · 0 评论 -
Intent info
<br />Description<br /> <br /> 1 明确指定start an activity or service<br /> 2 broadcast that an event (or action) has occurred<br /> 3 Declare your intention that an Activity or Service be started to perform an action, usually<br />with (or on) a particular原创 2010-06-01 17:53:00 · 334 阅读 · 0 评论 -
INTRODUCING DIALOGS
<br />There are three ways to implement a dialog in Android: .<br /> <br />1. Using the Dialog class (or its extensions) As well<br />as the general-purpose AlertDialog class, Android<br />includes a number of specialist classes that extend<br />Dialog.<br原创 2010-06-02 11:32:00 · 429 阅读 · 0 评论 -
INTRODUCING PENDING INTENTS
<br />// Start an Activity<br />Intent startActivityIntent = new Intent(this, MyOtherActivity.class);<br />PendingIntent.getActivity(this, 0, startActivityIntent, 0);<br />// Broadcast an Intent<br />Intent broadcastIntent = new Intent(NEW_LIFEFORM_DETECTE原创 2010-06-02 10:57:00 · 297 阅读 · 0 评论 -
Using Intents to Broadcast Events
<br />public static final String NEW_LIFEFORM_DETECTED ="com.paad.action.NEW_LIFEFORM";<br /> <br />Broadcasting an Intent<br /> <br />Intent intent = new Intent(NEW_LIFEFORM_DETECTED);<br />intent.putExtra("lifeformName", lifeformType);<br />intent.putExt原创 2010-06-02 10:34:00 · 388 阅读 · 0 评论 -
Text link
<br />Linkify<br />TextView textView = (TextView)findViewById(R.id.myTextView);<br />Linkify.addLinks(textView, Linkify.WEB_URLS|Linkify.EMAIL_ADDRESSES);<br /> <br />Use linkify in xml<br /> <br /><TextView<br />android:layout_width="fill_parent"<br />and原创 2010-06-02 10:17:00 · 521 阅读 · 0 评论 -
Android menu system
1.Icon menu icon&short text2.Expaned menu3.Submenuscreate icon menupublic boolean onCreateOptionsMenu(Menu menu){}// Create a new check box item.menu.add(0, CHECKBOX_ITEM, Menu.NONE, "CheckBox").setCheckable(true);// Create a radio button group.menu.add(RB原创 2010-06-01 16:52:00 · 771 阅读 · 0 评论 -
Activity 生命周期
Activty lifetimes like thisonCreate--->onRestart----->onStart---->onResume---->onRestoreInstanceState---->onSaveInstanceState---->onPause----->onStop---->onDestory其中onResume到onPause为active周期onStart到onStop 为invisible onCreate 整个生命周的第一个环节,用来初始化Activity 和 inc原创 2010-06-01 10:59:00 · 368 阅读 · 0 评论 -
Android string format with html
<br /><string name="stop_message"><b>Stop</b>. %1$s</string><br /> <br /> <br />like this<br /> <br />String rString = getString(R.string.stop_message);<br />String fString = String.format(rString, "Collaborate and listen.");<br />CharSequence styled原创 2010-05-31 16:55:00 · 927 阅读 · 0 评论 -
styles and theme
<br /><?xml version="1.0" encoding="utf-8"?><br /><resources><br /><style name="BaseText"><br /><item name="android:textSize">14sp</item><br /><item name="android:textColor">#111</item><br /></style><br /><style name="SmallText" parent="BaseText"><br /><it原创 2010-05-31 17:00:00 · 300 阅读 · 0 评论 -
get resource from xml
<br />Resources myResources = getResources();<br />CharSequence styledText = myResources.getText(R.string.stop_message);<br />Drawable icon = myResources.getDrawable(R.drawable.app_icon);<br />int opaqueBlue = myResources.getColor(R.color.opaque_blue);<br原创 2010-05-31 17:41:00 · 439 阅读 · 0 评论 -
Working in the Background
Creating a Serviceimport android.app.Service;import android.content.Intent;import android.os.IBinder;public class MyService extends Service {@Overridepublic void onCreate() {// TODO: Actions to perform when service is created.}@Overridepublic IBinder onBin原创 2010-06-07 13:24:00 · 998 阅读 · 1 评论