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

New way to play group lottery activities!

Group buying is regarded as a social method under...

Smali disassembly language data types and methods

Introduction to Smali Smali is a disassembly lang...

“Birds of a feather flock together” now has scientific basis!

Several experiments have shown that people with s...

The colonoscopy results were normal, so how come he suddenly got colon cancer?

Data show that colonoscopy screening for colorect...

4 key points for high-quality community operations!

If you are interested in community operations , p...

How does Tmall create anthropomorphic IP?

People say that the "New Year atmosphere&quo...

These processes of Apple cannot be copied

[[123145]] "The last thing I want to say abo...

Offline operation promotion: 28 ways to attract new customers!

Today I will introduce to you offline methods of ...