2012-11-18 25 views
0

我开发和Android应用我的毕业设计显示数据。我成功地将一些用户信息和详细信息存储在数据库中,参考了一些在线教程和示例。不过,我需要帮助来显示用户和一些用户输入信息到主页面。类似于facebook主页。有人可以给我一个方向线索或任何在线文章或教程寻找?非常感谢您的帮助,谢谢。安卓:从数据库中单个页面的活动

这是我的PHP的一部分文件存储用户信息和用户的输入。我想在一个页面中显示它们全部。我应该编码我的XML文件和主要活动类文件?

else if ($tag == 'report') { 
     //Request type is report location report 
     $name = $_POST['name']; 
     $address = $_POST['address']; 
     $traffic = $_POST['traffic']; 
     $whathappen = $_POST['whathappen']; 
     $comment = $_POST['comment']; 

     //store information 
     $report = $db->storeReport($address, $traffic, $whathappen, $comment); 
     if($report) { 
      //report stored successfully 
      //$response["success"] = 1; 
      $responce["report"]["name"] = $report["name"]; 
      $responce["report"]["address"] = $report["address"]; 
      $responce["report"]["traffic"] = $report["traffic"]; 
      $responce["report"]["whathappen"] = $report["whathappen"]; 
      $responce["report"]["comment"] = $report["comment"]; 
      $responce["report"]["created_at"] = $report["created_at"]; 
      $responce["report"]["updated_at"] = $report["updated_at"]; 
      echo json_encode($responce); 
     } 

回答

0

有很多选择满足您的要求。您可以与用户输入的一串EditText框和用于显示信息的一堆TextViews创建活动。

好像你需要一个好的初学者课程Android开发获得的actvities,布局,按钮,监听器等挂我推荐优秀的谷歌官方开发人员指南这里:

http://developer.android.com/training/index.html

如果您知道这些,那么你可以阅读数据库。这里有一个很好的教程:

http://www.androidhive.info/2011/11/android-sqlite-database-tutorial/

一旦你从DATABSE的数据,你可以使用TextView.setText()方法只是将这些值指定给TextViews

+0

谢谢,我知道如何创建和使用EditText和TextView,只是不知道如何检索放入EditText和TextView的信息。我会试试看。 – RaymondTiew