i am designing a sms application for android. i have been successful in sending and receiving the sms. The only problem i have been facing is the layout of the inbox and outbox of my app. I am putting up a image of what i want output like and what i am actually getting right now. Can anyone guide me in achieving the desired result.
The code i have used to fill the inbox is as below
public class Inbox extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inbox);
ListView list = (ListView) findViewById(R.id.list);
List<String> msgList = getSMS();
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, msgList);
list.setAdapter(adapter);
}
public List<String> getSMS() {
List<String> sms = new ArrayList<String>();
Uri uriSMSURI = Uri.parse("content://sms/inbox");
Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null);
while (cur.moveToNext()) {
String address = cur.getString(cur.getColumnIndex("address"));
String body = cur.getString(cur.getColumnIndexOrThrow("body"));
sms.add("Number: " + address + " .Message: " + body);
}
return sms;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_inbox, menu);
return true;
}
}

Create two activities or fragments and get only the number from database in the first and in the second get the messages related to that number and learn how to create custom listviews
Suggested links:
http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/
http://www.ezzylearning.com/tutorial.aspx?tid=1763429
http://www.thepcwizard.in/2012/09/android-creating-custom-listview-for.html