Android之与当前连接的wifi进行文件夹的浏览与传输
摘要:先上传jar文件;ConnectWifi.jar.zip上传源文件:org.zip使用实例及相应的注释;import java.io.File;import java.net.InetAddress;import org.swiftp.Defaults;import org.swiftp.FTPServerService;import org.swiftp.Globals;import org.swiftp.UiUpdater;import android.app.Activity;import android.content.Context;import android.content.In
阅读全文
posted @
2013-10-27 15:53
lee0oo0
阅读(2297)
推荐(0) 编辑
android之app widget(三)
摘要:1. 接受来自App Widget的广播 //Androidmanifest中的文件旨要,只要有个一action符合就会调用继承AppWidgetProvider的类: <receiver android:name="继承AppWidgetProvider的类"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATA"/> </intent-filter> <intent-filter> &
阅读全文
posted @
2012-03-14 15:29
lee0oo0
阅读(310)
推荐(0) 编辑
android之app widget(二)
摘要:PendingIntent: //创建PendingIntent的方法: getActivity(Context context,int requestCode,Intent intent,int flags) //启动一个Activity getBroadcast(Context context,int requestCode,Intent intent,int flags) //发送一个广播 getService(Context context,int requestCode,Intent intent,int flags) //...
阅读全文
posted @
2012-03-13 17:19
lee0oo0
阅读(321)
推荐(0) 编辑
android之app widget(一)
摘要:1.AppWidgetProviderInfo对象: 为App Widget提供元数据(meta-data),包括布局,更新频率等等数据。这个对象被定义在res/xml目录当中。 <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="294dp" android:minHeight="72dp" android:updatePeriodMillis="86400000"
阅读全文
posted @
2012-03-13 16:22
lee0oo0
阅读(435)
推荐(0) 编辑
android之监听手机来电状态
摘要://获得相应的系统服务 TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); //使用TelephonyManager对象的listen(PhoneStateListenerlistener, int events) 第一个参数需要实现PhoneStateListenerlistener并实现相应的方法,第二个参数是PhoneStateListener的静态常量,此处由于是监听电话状态,所以需要传 入LISTEN_CALL_STATE...
阅读全文
posted @
2012-03-13 14:36
lee0oo0
阅读(1947)
推荐(0) 编辑
android之手势添加&识别
摘要:布局XML: <android.gesture.GestureOverlayView android:id="@+id/gesture1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gestureStrokeType="multiple"> </android.gesture.GestureOverlayView>***android.gesture.GestureOverla
阅读全文
posted @
2012-03-13 11:37
lee0oo0
阅读(2493)
推荐(0) 编辑
android之接收和发送广播的开机可自动运行程序
摘要:在AndroidManifest中指定的: <receiver android:name=".StartupReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> ***开机启动后系统发出的BroadcastReceiver <category android:name="android.intent.category.HOME" /> ***系统显示后第一个启动
阅读全文
posted @
2012-03-13 11:06
lee0oo0
阅读(1062)
推荐(0) 编辑
第8章 Service基础Activity与Service绑定
摘要:要知道如果调用函数startService方法,那么即使你的程序退出了,但是Service依然运行在后台;也就是说此时想要停止service必须调用stopService方法。 现在我们把Activity与Service绑定在一起,那就是Service要随着程序的退出而终止,此时调用的方法为bindService方法,方法如下: A.编写需要运行在后台的类继承自android.app.Service。 public class MyService extends Service { //服务生命周期 创建,开始,销毁 /** ...
阅读全文
posted @
2012-03-11 16:42
lee0oo0
阅读(5747)
推荐(0) 编辑
第8章 Service基础
摘要:Service并没有实际界面,而是一直在Android后台运行。服务的主要目的:后台运行和跨进程访问。Service就像Activity有自己的生命周期,创建—>开始—>销毁。 一个服务实际上是继承android.app.Service。一个服务只会创建一次、销毁一次,但是可以开始多次。 Service也需要在AndroidManifest中进行配置,在<application>标签中添加如下代码: <service android:name=".myService(继承service的类)" android:enable="true
阅读全文
posted @
2012-03-09 00:37
lee0oo0
阅读(469)
推荐(0) 编辑
第4章 Notification与状态栏信息
摘要:创建并显示一个Notification的步骤: 1. 通过getSystemService方法获得一个NotificationManager对象 ——NotificationManager notificationManager = (NotificationManager)getSystemManager(NOTIFICATION_SERVICE); 2. 创建一个Notification对象。每一个Notification对应一个Notification对象。在这一步需要设置显示在屏幕上方状态的通知信息、通知消息前方的图像资源ID和发出通知的时 间,一般为当前时间。 ...
阅读全文
posted @
2012-03-08 15:54
lee0oo0
阅读(385)
推荐(0) 编辑