当前位置: 编程技术>移动开发
本页文章导读:
▪ListView例证 ListView例子
例子一:public class ListActivity extends android.app.ListActivity{
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Li.........
▪ Visibility不足见设置 Visibility不可见设置
((ProgressBar)findViewById(R.id.progressBar1)).setVisibility(View.VISIBLE)
......
▪ jlibrtp 有关资料 jlibrtp 相关资料
The jlibrtp package contains the core classes of jlibrtp. Most of these classes are protected or private, developers looking to use jlibrtp should only concern themselves with
RTPSession - the main session object
Participant - .........
[1]ListView例证
来源: 互联网 发布时间: 2014-02-18
ListView例子
例子一:
编写一个user.xml在/res/layout中
例子二:
编写list_item.xml在/res/layout中
例子三:
编写list_item.xml在/res/layout中
编写strings.xml在/res/values中
例子一:
public class ListActivity extends android.app.ListActivity{ /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); List<Map<String,String>> list = new ArrayList<Map<String,String>>(); Map<String,String> map1 = new HashMap<String,String>(); Map<String,String> map2 = new HashMap<String,String>(); map1.put("name", "zhangsan"); map1.put("ip", "0.1"); map2.put("name", "lisi"); map2.put("ip", "0.2"); list.add(map1); list.add(map2); SimpleAdapter sa = new SimpleAdapter(this, list, R.layout.user, new String[]{"name","ip"}, new int[]{R.id.user_id,R.id.user_ip}); setListAdapter(sa); } }
编写一个user.xml在/res/layout中
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal"> <TextView android:layout_height="wrap_content" android:id="@+id/user_id" android:layout_width="wrap_content" android:text="TextView" android:layout_weight="1"></TextView> <TextView android:layout_height="wrap_content" android:id="@+id/user_ip" android:layout_width="wrap_content" android:text="TextView" android:layout_weight="1"></TextView> </LinearLayout>
例子二:
public class HelloListView extends ListActivity { static final String[] COUNTRIES = new String[] { "Afghanistan", "Albania", "Algeria", "American Samoa" }; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, COUNTRIES)); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show(); } }); } }
编写list_item.xml在/res/layout中
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:textSize="16sp" > </TextView>
例子三:
public class ListViewActivity extends ListActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String[] countries = getResources().getStringArray(R.array.countries_array); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, countries)); ListView lv = getListView(); lv.setTextFilterEnabled(true); } }
编写list_item.xml在/res/layout中
<?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:textSize="16sp" > </TextView>
编写strings.xml在/res/values中
<string-array name="countries_array"> <item>Bahrain</item> <item>Bangladesh</item> <item>Barbados</item> <item>Belarus</item> <item>Belgium</item> <item>Belize</item> <item>Benin</item> </string-array>
[2] Visibility不足见设置
来源: 互联网 发布时间: 2014-02-18
Visibility不可见设置
((ProgressBar)findViewById(R.id.progressBar1)).setVisibility(View.VISIBLE)
[3] jlibrtp 有关资料
来源: 互联网 发布时间: 2014-02-18
jlibrtp 相关资料
The jlibrtp package contains the core classes of jlibrtp. Most of these classes are protected or private, developers looking to use jlibrtp should only concern themselves with
- RTPSession - the main session object
- Participant - participant objects
- DataFrame - the containers in which data is returned
- RTPAppIntf - the mininum callback interface
- RTPCAppIntf - optional interface for receing RTCP packets
- RTCPAVPFIntf - optional interface for RTP with feedback
- DebugAppIntf - optional interface for debugging
DebugAppIntf is great for checking network problems and keeping track of packets. If you need extensive debugging you should statically change the debug values in RTPSession.java and pay attention to the standard output.
项目HOST
http://sourceforge.net/projects/jlibrtp/
android port by hsc
http://www.hsc.com/tabid/87/ctl/Display/ID/22/mid/637/Default.aspx
介绍
http://www.powershow.com/view/15e732-MGM2Y/jlibrtp_RTP_Java_Library_flash_ppt_presentation
最新技术文章: