bmob个人失物应用_app开发模板

移动开发
该源码功能上非常单一,但请从源码封装及架构的角度来看待。上传此源码主要有两点目的:一、学习并体验Bmob云存储二、站在架构的角度,学习Android平台下app开发过程中的整合【封装】

源码简介

该源码功能上非常单一,但请从源码封装及架构的角度来看待。

上传此源码主要有两点目的:

一、学习并体验Bmob云存储

二、站在架构的角度,学习Android平台下app开发过程中的整合【封装】

源码运行截图

源码片段

  1. /** 
  2.      * 查询全部失物信息 queryLosts 
  3.      * 
  4.      * @return void 
  5.      * @throws 
  6.      */ 
  7.     private void queryLosts() { 
  8.         showView(); 
  9.         BmobQuery<lost> query = new BmobQuery<lost>(); 
  10.         query.order("-createdAt");// 按照时间降序 
  11.         query.findObjects(thisnew FindListener<lost>() { 
  12.   
  13.             @Override 
  14.             public void onSuccess(List<lost> losts) { 
  15.                 // TODO Auto-generated method stub 
  16.                 LostAdapter.clear(); 
  17.                 FoundAdapter.clear(); 
  18.                 if (losts == null || losts.size() == 0) { 
  19.                     showErrorView(0); 
  20.                     LostAdapter.notifyDataSetChanged(); 
  21.                     return
  22.                 } 
  23.                 progress.setVisibility(View.GONE); 
  24.                 LostAdapter.addAll(losts); 
  25.                 listview.setAdapter(LostAdapter); 
  26.             } 
  27.   
  28.             @Override 
  29.             public void onError(int code, String arg0) { 
  30.                 // TODO Auto-generated method stub 
  31.                 showErrorView(0); 
  32.             } 
  33.         }); 
  34.     } 
  35.   
  36.     public void queryFounds() { 
  37.         showView(); 
  38.         BmobQuery<found> query = new BmobQuery<found>(); 
  39.         query.order("-createdAt");// 按照时间降序 
  40.         query.findObjects(thisnew FindListener<found>() { 
  41.   
  42.             @Override 
  43.             public void onSuccess(List<found> arg0) { 
  44.                 // TODO Auto-generated method stub 
  45.                 LostAdapter.clear(); 
  46.                 FoundAdapter.clear(); 
  47.                 if (arg0 == null || arg0.size() == 0) { 
  48.                     showErrorView(1); 
  49.                     FoundAdapter.notifyDataSetChanged(); 
  50.                     return
  51.                 } 
  52.                 FoundAdapter.addAll(arg0); 
  53.                 listview.setAdapter(FoundAdapter); 
  54.                 progress.setVisibility(View.GONE); 
  55.             } 
  56.   
  57.             @Override 
  58.             public void onError(int code, String arg0) { 
  59.                 // TODO Auto-generated method stub 
  60.                 showErrorView(1); 
  61.             } 
  62.         }); 
  63.     } 
  64.   
  65. ······ 
  66.     /** 
  67.      * Add links into a TextView. 
  68.      * @param viewId The id of the TextView to linkify. 
  69.      * @return The BaseAdapterHelper for chaining. 
  70.      */ 
  71.     public BaseAdapterHelper linkify(int viewId) { 
  72.         TextView view = retrieveView(viewId); 
  73.         Linkify.addLinks(view, Linkify.ALL); 
  74.         return this
  75.     } 
  76.   
  77.     /** Apply the typeface to the given viewId */ 
  78.     public BaseAdapterHelper setTypeface(int viewId, Typeface typeface) { 
  79.         TextView view = retrieveView(viewId); 
  80.         view.setTypeface(typeface); 
  81.         return this
  82.     } 
  83.   
  84.     /** Apply the typeface to all the given viewIds */ 
  85.     public BaseAdapterHelper setTypeface(Typeface typeface, int... viewIds) { 
  86.         for (int viewId : viewIds) { 
  87.             TextView view = retrieveView(viewId); 
  88.             view.setTypeface(typeface); 
  89.         } 
  90.         return this
  91.     } 
  92. </found></found></found></found></lost></lost></lost></lost> 
源码链接:http://down.51cto.com/data/1968339
责任编辑:chenqingxiang 来源: 网络整理
相关推荐

2015-03-26 10:49:23

bmobapp

2011-12-29 15:28:37

App CookeriOS应用

2013-03-08 02:46:00

个人开发APP

2013-03-08 02:31:38

2013-09-09 14:26:25

iOS应用内置付费In-App Purc

2017-12-11 10:18:01

2013-07-04 13:19:24

Java开发速度

2011-12-05 14:50:13

Knockout

2021-01-18 13:17:04

鸿蒙HarmonyOSAPP

2014-12-17 10:29:59

混合应用Hybrid App开发实战

2022-10-08 16:26:23

APP应用开发

2013-12-20 11:16:45

个人市场企业应用

2012-04-17 08:55:48

个人开发者开发心得

2015-07-30 09:13:05

GlowAppleWatch

2012-12-04 09:18:02

2013-03-08 02:55:30

2012-03-08 21:38:26

Android

2010-11-16 09:23:13

敏捷开发Visual Stud

2012-03-09 13:56:27

MITAndroid开发工具

2010-06-18 17:44:36

Linux Anacr
点赞
收藏

51CTO技术栈公众号