bmob personal lost property application_app development template

bmob personal lost property application_app development template

Source code introduction

The source code is very simple in function, but please look at it from the perspective of source code packaging and architecture.

There are two main purposes for uploading this source code:

1. Learn and experience Bmob cloud storage

2. From the perspective of architecture, learn the integration of app development in the Android platform [Packaging]

Source code running screenshot

Source code snippet

  1. /**
  2. * Query all lost property information 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" ); // In descending order of time  
  11. query.findObjects( this , new 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" ); // In descending order of time  
  40. query.findObjects( this , new 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>
Source code link: http://download..com/data/1968339

<<:  Android Pulley

>>:  Android custom ListView to implement contact sorting

Recommend

Every crazy boss has forced the new media department to learn from Durex

Yesterday in teacher Liu Run’s circle of friends ...

5 operational lessons learned from Sina Weibo's second rise

Regarding Sina Weibo , let me first show you thre...

Android 1.0 vs Android 9: A decade of change

In a blink of an eye, Android has become a 10-yea...

How to optimize and quickly increase the number of app store users?

On my first day at CallApp, the CEO gave me an ex...

How to develop an Apple App of the Year? See what the founder of Replay said

Replay is a video editing software with similar f...

Theoretical basis for improving your App startup speed

1. To do a good job, you must first sharpen your ...

47! The first batch of national civilized tourism demonstration units are here

On November 18, the National Tourism Standardizat...

Great news for mobile phone users! Android 6.0 source code released

[[151054]] OTA push has started, the original ima...