-
Android 简单播放歌曲功能演示
Android 简单播放歌曲功能演示,播放本地音乐,非网络播放,可播放、暂停,运行效果如截图所示,在编写时,要注意以下代码:
int status = 1;//当前的状态,1没有声音播放 ,2 正在播放声音,3暂停
ImageButton start;//播放、暂停按钮
ImageButton stop;//停止按钮
ActivityReceiver activityReceiver;
int status = 1;//当前的状态,1没有声音播放 ,2 正在播放声音,3暂停
public void onCreate(Bundle savedInstanceState) {//重写的onCreate方法
super.onCreate(savedInstanceState);
setContentView(R.layout.main);//设置当前的用户界面
start = (ImageButton) this.findViewById(R.id.start);//得到start的引用
stop = (ImageButton) this.findViewById(R.id.stop);//得到stop按钮的引用
start.setOnClickListener(this);//为按钮添加监听
stop.setOnClickListener(this);//为按钮添加监听
activityReceiver = new ActivityReceiver();//创建BroadcastReceiver
IntentFilter filter = new IntentFilter();//创建IntentFilter过滤器
filter.addAction("wyf.ytl.update");//添加Action
registerReceiver(activityReceiver, filter);//注册监听
Intent intent = new Intent(this, MyService.class);//创建Intent
startService(intent);//启动后台Service
}
- 2023-08-23 12:30:03下载
- 积分:1
-
android 异步 执行 任务 例子 附讲解
Rules::The AsyncTask instance must be created in UI thread. .execute must be invoked on the UI thread.Never call objMyTask.onPreExecute(), objMyTask.doInBackground(), objMyTask.onProgressUpdate(), objMyTask.onPostExecute manually.The AsyncTask can be executed only once (an exception will be thrown if a second execution is attempted.)AsyncTask have Four Main Method... onPreExecute() doInBackground() onProgressUpdate() onPostExecute() onPreExecute-This method is called first when you start AsyncTask using objAsync.execute().And mostly this method is use for initializing dialog(ProgressDialog,CustomDialog) and showing. doInBackground-The main purpose of AsyncTask is accomplished by this method.Any non-UI thread process is running in this method.Such as Rss Feed Reader,Image and video Uploading and Downloading.You cant handle your View in this method.Because this method is non-UI thread.While any background process is running if you want to handle UI therea are onProgressUpdate method. after completion of process this method send result to OnPostExecute. onProgressUpdate-While backgrounding task is running ,you can handle your UI using this method .Such as status of downloading or uploading task.and this method is called from doInBackground.Using publishProgress() you can call onProgressUpdate method to update UI while process is running. onPostExecute -This method is called after the background computation finishes.The result of background process in passed in this method as parameters.And now you can dismiss progress dialog ,to indicate that background task is completed. You can cancel AsyncTask using objAsyncTask.cancel().then you just check in doInBackground, if (isCancelled()) { break; } else { //continue... } See this Image For more Clear.
- 2013-07-05下载
- 积分:1
-
蓝牙调试助手 实例源码下载
接收发送蓝牙消息、建立蓝牙通信连接、打印蓝牙消息
- 2014-08-27下载
- 积分:1
-
微信打飞机源码
应用背景仿照微信打飞机,制作的android源码,代码简单,通俗易懂,很容易理解。仿照微信打飞机,制作的android源码,代码简单,通俗易懂,很容易理解。仿照微信打飞机,制作的android源码,代码简单,通俗易懂,很容易理解。仿照微信打飞机,制作的android源码,代码简单,通俗易懂,很容易理解。仿照微信打飞机,制作的android源码,代码简单,通俗易懂,很容易理解。仿照微信打飞机,制作的android源码,代码简单,通俗易懂,很容易理解。关键技术
android、java,xml,web;android、java,xml,web;android、java,xml,web;android、java,xml,web;android、java,xml,web;android、java,xml,web;android、java,xml,web;android、java,xml,web;
- 2022-10-07 19:15:03下载
- 积分:1
-
DishSystemClient
自己写的一个安卓无限点餐系统,安卓系统,能够连接无线,进行快捷式的点餐~~(Himself wrote a Android the infinite ordering system, Android system that can connect to a wireless, fast ordering ~ ~)
- 2013-05-06 23:09:33下载
- 积分:1
-
a tool to monitor current traffic of total mobile system including average traffic speed and runtime
一个小工具 采用android系统api 可以监测系统应用的流量使用和当前网速
- 2022-08-09 15:37:38下载
- 积分:1
-
ELamp
Android灯应用源码,包括霓虹灯效果。(Android lamp application source code, including the neon light effect.)
- 2012-11-16 11:50:00下载
- 积分:1
-
视频和音频捕捉和记录的源代码
这个程序函数作为提1.使用麦克风录音。2.用摄像机录像。3.将此文件存储在 sd 卡中。
- 2022-12-16 23:30:03下载
- 积分:1
-
AccountSetupIncoming
Account Setup Incoming for Andriod.
- 2013-10-06 00:35:28下载
- 积分:1
-
芳的源代码 1
这个应用程序是有关 SMS 发送和接收应用程序,可以手动或自动控制的 sheudulled。
- 2022-03-25 22:31:22下载
- 积分:1