2010年11月29日
$jQuery('#createTb').children().get(0).removeChild($jQuery('#createTb').children().get(0).lastChild);
set sdk home windows ->property->android . So it is.
自带的JoinMe软件是有拨号功能
把N600连在电脑上,在手机上 选"设置"____ "应用" ____"开发"把"USB调试"打开,就能用了
在进行android-sdk-windows中进行 update all时, 报错 folder failed to be renamed or moved 2010-05-10 14:56 在进行android-sdk-windows中进行 update all时, 报错 folder failed to be renamed or moved...,goole了一下,有外国网友解决办法如下:
1, 复制 tools目录 为一个新的目录 tools-copy ,此时在android-sdk-windows 目录下有两个目录 tools 和 tools-copy
2, 在tools-copy目录运行 android.bat ,这样就可以正常 update all 了
3,之后,关闭 sdk,
4, 在 android-sdk-windows 目录运行 SDK Setup.exe, 就可以了
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DictionaryOpenHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 2;
private static final String DICTIONARY_TABLE_NAME = " user ";
private static final String DICTIONARY_TABLE_CREATE =
"CREATE TABLE " + DICTIONARY_TABLE_NAME + " (" +
"id" + " int, " +
"name" + " TEXT);";
DictionaryOpenHelper(Context context) {
super(context, "airib_database", null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
// db.execSQL(DICTIONARY_TABLE_CREATE);
}
@Override
public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2)
{
}
}
package fil.ted.test;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Environment;
import android.util.Log;
public class TestDAO
{
public static String getString(Activity activity)
{
// StringBuffer strBuf = new StringBuffer(Environment.getDataDirectory().toString());
// strBuf.append("/data/data/");
// strBuf.append("fil.ted.test");
//
// strBuf.append("/databases/");
// strBuf.append("air");
// String dbPath = strBuf.toString();
// SQLiteDatabase db = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);
// db.execSQL("select id from airib");
DictionaryOpenHelper mDbHelper= new DictionaryOpenHelper(activity);
SQLiteDatabase db = mDbHelper.getReadableDatabase();
String [] strr ={"id","name"};
Cursor cursor = db.query("user", strr,
null, null, null, null, null);
//return cursor.toString();
String str = "start---";
if(cursor.moveToFirst()){
do{
str = str+cursor.getString(0)+cursor.getString(1)+""t";
}while(cursor.moveToNext());
}
return str;
}
/**
* @param args
*/
public static void main(String[] args)
{
System.out.println(12);
}
}
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;
public class ImageAdapter extends BaseAdapter {
//定义Context,即Activity
private Context context;
//定义整型数组 即图片源。
private Integer image[]
=
{
R.drawable.add_symbol,
R.drawable.delete_icon,
R.drawable.delete_key,
R.drawable.neato,
R.drawable.plus,
R.drawable.igoogle_logo_sm
};
public ImageAdapter(Context c) throws IllegalArgumentException, IllegalAccessException{
context=c;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
//获取图片个数。
return Integer.MAX_VALUE;
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
//获取图片在库中的位置。
return position;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
//获取图片在库中的位置。
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ImageView imageview=new ImageView(context);
//给imageView设置图片资源。
imageview.setImageResource(image[position%image.length]);
//设置比例类型。
imageview.setScaleType(ImageView.ScaleType.FIT_XY);
//设置图片布局和显示大小。
imageview.setLayoutParams(new Gallery.LayoutParams(100,100));
//设置图片之间的距离。
imageview.setPadding(15,0,15,0);
return imageview;
}
}
setContentView(R.layout.main);
// 初始化Gallery。
gallery = (Gallery) findViewById(R.id.gallery);
try
{
// 设置Gallery的Adapter。
gallery.setAdapter(new ImageAdapter(TestAndroidActivity.this));
}
catch (IllegalArgumentException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IllegalAccessException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
// 点击事件。
gallery.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView arg0, View arg1, int itemid, long arg3)
{
// TODO Auto-generated method stub
setTitle("您点击了第" + String.valueOf(itemid + 1) + "项");
}
});
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<gallery android:id="@+id/gallery" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margintop="30dp">
</gallery>
</linearlayout>
scrollView.scrollTo(0,0);
Context context = getApplicationContext();
CharSequence text = "have a toast thank you ,you've got it!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
- Get a reference to the NotificationManager:
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
- Instantiate the Notification:
int icon = R.drawable.notification_icon;
CharSequence tickerText = "Hello";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText, when);
- Define the Notification's expanded message and Intent:
Context context = getApplicationContext();
CharSequence contentTitle = "My notification";
CharSequence contentText = "Hello World!";
Intent notificationIntent = new Intent(this, MyClass.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
- Pass the Notification to the NotificationManager:
private static final int HELLO_ID = 1;
mNotificationManager.notify(HELLO_ID, notification);
That's it. Your user has now been notified.
|
|
| 日 | 一 | 二 | 三 | 四 | 五 | 六 |
---|
31 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
|
常用链接
留言簿
随笔档案
文章档案
相册
搜索
最新评论
阅读排行榜
评论排行榜
|
|