Android ???????????
???????????? ???????[ 2013/5/14 13:43:47 ] ????????
???????磬???AsyncTask??????????????
????[java] view plaincopyprint?
????public void onClick(View v) {
????new DownloadImageTask().execute("http://example.com/image.png");
????}
????private class DownloadImageTask extends AsyncTask {
????/** The system calls this to perform work in a worker thread and
????* delivers it the parameters given to AsyncTask.execute() */
????protected Bitmap doInBackground(String... urls) {
????return loadImageFromNetwork(urls[0]);
????}
????/** The system calls this to perform work in the UI thread and delivers
????* the result from doInBackground() */
????protected void onPostExecute(Bitmap result) {
????mImageView.setImageBitmap(result);
????}
????}
????public void onClick(View v) {
????new DownloadImageTask().execute("http://example.com/image.png");
????}
????private class DownloadImageTask extends AsyncTask {
????/** The system calls this to perform work in a worker thread and
????* delivers it the parameters given to AsyncTask.execute() */
????protected Bitmap doInBackground(String... urls) {
????return loadImageFromNetwork(urls[0]);
????}
????/** The system calls this to perform work in the UI thread and delivers
????* the result from doInBackground() */
????protected void onPostExecute(Bitmap result) {
????mImageView.setImageBitmap(result);
????}
????}
????????UI???????????????????????????????????е????????UI????????????????
????????òο?AsyncTask??????????????????????????????????????????????裺
????· ????????generics?Task??????????????????????
????· ????doInBackground()?????????????????????С?
????· ????onPreExecute()??onPostExecute()??onProgressUpdate????UI????е??á?
????· ????doInBackground()?????????????onPostExecute()??????
????· ???????doInBackground()?????????publishProgress()???????÷??????????UI????е?onProgressUpdate()?????????????????????????????????
????· ?????????????????????????????????С?
???????????????????????仯(???????????????)???????????????????????????????????????£????????????????????????ο?Android????????Shelves???????????????μ?????
??????д“?????”????
???????Щ????£????д????????????????????????????????????????“?????”???
????“?????”???????????÷??????????????—???????“??”??Service?е?????????????IBinder??????????е???IBinder????????????÷?????????????????е???????С??????????????????????????????ú????IBinder?????????????????е???????(??y????е?UI???)?????IBinder??????????磬???Service??onBind()???????????Service?????UI????е????????onBind()????????(?????????????RPC??????????)????????????????????????С?????Service???????????????????????????????е???????????IBinder?????????????????IBinder???????????????????????
?????????????Content Provider???????????????????????????????????ContentResolver??ContentProvider?????????????Щ????????????????????????????Щ????????query()?? insert ()?? delete ()?? update () ??getType() ?????Щ????????Content Provider?????????????????????С???????Щ???????в????????????????????????Щ???????????????????
????????????
????Android??????????????(RPC)????????????(IPC)??????????????Activity?????????????????????????????÷?????????????????????????(??????)?????????????????????????????????????ú????????????????Σ???????ò???????????????????????????????????????????????1???????????з????????????????????????Android???????????Щ????????????????д???????????????????????????????????
?????????y???????(IPC)??????????????bindService()???????Service??
??????

???·???
App??С????H5?????????????????Щ??
2024/9/11 15:34:34?????????????????????????
2024/9/10 11:13:49P-One ???????????????????????????????????????
2024/9/10 10:14:12???????????????????????????
2024/9/9 18:04:26??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44