PSP游戏中心软件代码.docx
- 文档编号:25856167
- 上传时间:2023-06-16
- 格式:DOCX
- 页数:133
- 大小:48.05KB
PSP游戏中心软件代码.docx
《PSP游戏中心软件代码.docx》由会员分享,可在线阅读,更多相关《PSP游戏中心软件代码.docx(133页珍藏版)》请在冰豆网上搜索。
PSP游戏中心软件代码
PSP游戏中心软件
源代码
版本号:
V1.0
江西师范大学
Fragment1.java
packagezdw.pspgame;
importcom.mozillaonline.downloadprovider.R;
importcom.mozillaonline.providers.DownloadManager;
importcom.mozillaonline.providers.DownloadManager.Request;
importcom.mozillaonline.providers.downloads.DownloadService;
importcom.mozillaonline.providers.downloads.ui.DownloadList;
importandroid.content.Context;
importandroid.content.Intent;
importandroid.content.SharedPreferences;
import.Uri;
importandroid.os.Bundle;
importandroid.support.v4.app.Fragment;
importandroid.view.LayoutInflater;
importandroid.view.View;
importandroid.view.View.OnClickListener;
importandroid.view.ViewGroup;
importandroid.widget.ImageView;
importandroid.widget.TextView;
importzdw.pspgame.gamekind.GameListActivity;
importzdw.pspgame.gamekind.rpgActivity;
publicclassFragment1extendsFragment{
TextViewbt_rpg,bt_puz,_bt_ftg,bt_act;
ImageViewbt_ppsspp;
DownloadManagermDownloadManager;
Stringdownload_adress;
@Override
publicvoidonCreate(BundlesavedInstanceState){
//TODOAuto-generatedmethodstub
super.onCreate(savedInstanceState);
}
@Override
publicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){
//TODOAuto-generatedmethodstub
Viewview=inflater.inflate(R.layout.tab1,container,false);
TextViewbt_rpg=(TextView)view.findViewById(R.id.rpg);
TextViewbt_act=(TextView)view.findViewById(R.id.act);
TextViewbt_puz=(TextView)view.findViewById(R.id.puz);
ImageViewbt_ppsspp=(ImageView)view.findViewById(R.id.ppsspp);
mDownloadManager=newDownloadManager(getActivity().getContentResolver(),getActivity().getPackageName());
startDownloadService();
bt_ppsspp.setOnClickListener(newOnClickListener(){
@Override
publicvoidonClick(Viewv){
//TODOAuto-generatedmethodstub
download_adress="
Stringurl=download_adress;
UrisrcUri=Uri.parse(url);
DownloadManager.Requestrequest=newRequest(srcUri);
SharedPreferencesshare=getActivity().getSharedPreferences("perference",Context.MODE_PRIVATE);
Stringdownload=share.getString("download",null);
StringnewDown=download.replace("/sdcard/","");
request.setDestinationInExternalPublicDir(newDown,"/");
mDownloadManager.enqueue(request);
Intentintent=newIntent();
intent.setClass(getActivity(),DownloadList.class);
startActivity(intent);
}
});
bt_rpg.setOnClickListener(newOnClickListener(){
@Override
publicvoidonClick(Viewv){
//TODOAuto-generatedmethodstub
Intentintent_rpg=newIntent(getActivity(),rpgActivity.class);
startActivity(intent_rpg);
}
});
bt_act.setOnClickListener(newOnClickListener(){
@Override
publicvoidonClick(Viewv){
//TODOAuto-generatedmethodstub]
String[]names=newString[]{"战神:
斯巴达之魂","怪物猎人P3","火影忍者疾风传究极冲击"};
String[]descs=newString[]{"游戏容量:
1.03G","游戏容量:
1.03G","游戏容量:
1.03G"};
String[]kinds=newString[]{"动作类","动作类","动作类",};
int[]imageIds=newint[]{R.drawable.gw,R.drawable.mhp3,R.drawable.na,};
Intentintent=newIntent(getActivity(),GameListActivity.class);
Bundlebundle=newBundle();
bundle.putStringArray("name",names);
bundle.putStringArray("desc",descs);
bundle.putStringArray("kind",kinds);
bundle.putIntArray("image",imageIds);
intent.putExtras(bundle);
startActivity(intent);
}
});
bt_puz.setOnClickListener(newOnClickListener(){
@Override
publicvoidonClick(Viewv){
//TODOAuto-generatedmethodstub
String[]names=newString[]{"科隆方块"};
String[]descs=newString[]{"游戏容量:
56mb"};
String[]kinds=newString[]{"益智类"};
int[]imageIds=newint[]{R.drawable.kl};
Intentintent=newIntent(getActivity(),GameListActivity.class);
Bundlebundle=newBundle();
bundle.putStringArray("name",names);
bundle.putStringArray("desc",descs);
bundle.putStringArray("kind",kinds);
bundle.putIntArray("image",imageIds);
intent.putExtras(bundle);
startActivity(intent);
}
});
returnview;
}
privatevoidstartDownloadService(){
//TODOAuto-generatedmethodstub
Intentintent=newIntent();
intent.setClass(getActivity(),DownloadService.class);
getActivity().startService(intent);
}
}
Fragment2.java
packagezdw.pspgame;
importjava.util.ArrayList;
importjava.util.HashMap;
importjava.util.List;
importjava.util.Map;
importcom.mozillaonline.downloadprovider.R;
importandroid.os.Bundle;
importandroid.support.v4.app.Fragment;
importandroid.view.LayoutInflater;
importandroid.view.View;
importandroid.view.ViewGroup;
importandroid.widget.ListView;
importandroid.widget.SimpleAdapter;
publicclassFragment2extendsFragment{
privateString[]names=newString[]{"火影忍者疾风传究极冲击","战神:
斯巴达之魂","怪物猎人P3","最终幻想零式","铁拳6"};
privateString[]descs=newString[]{"游戏容量:
1.03G","游戏容量:
1.03G","游戏容量:
1.03G","游戏容量:
1.03G","游戏容量:
1.03G"};
privateString[]kinds=newString[]{"格斗类","动作类","动作类","动作类","角色扮演"};
privateint[]imageIds=newint[]{R.drawable.na,R.drawable.gw,R.drawable.mhp3,R.drawable.ff0,
R.drawable.tk6};
@Override
publicvoidonCreate(BundlesavedInstanceState){
//TODOAuto-generatedmethodstub
super.onCreate(savedInstanceState);
}
@Override
publicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){
//TODOAuto-generatedmethodstub
Viewview=inflater.inflate(R.layout.tab3,container,false);
List
for(inti=0;i Map listItem.put("header",imageIds[i]); listItem.put("personName",names[i]); listItem.put("desc",descs[i]); listItem.put("kind",kinds[i]); listItems.add(listItem); } SimpleAdaptersimleAdapter=newSimpleAdapter(getActivity(),listItems,R.layout.simple_item, newString[]{"personName","header","desc","kind"}, newint[]{R.id.name,R.id.header,R.id.desc,R.id.kind}); ListViewlist=(ListView)view.findViewById(R.id.mylist); list.setAdapter(simleAdapter); returnview; } } Fragment3.java packagezdw.pspgame; importjava.util.ArrayList; importjava.util.HashMap; importjava.util.List; importjava.util.Map; importcom.mozillaonline.downloadprovider.R; importandroid.content.Intent; importandroid.os.Bundle; importandroid.support.v4.app.Fragment; importandroid.view.LayoutInflater; importandroid.view.View; importandroid.view.ViewGroup; importandroid.widget.AdapterView; importandroid.widget.ListView; importandroid.widget.SimpleAdapter; importandroid.widget.AdapterView.OnItemClickListener; importzdw.pspgame.game.mhp3Activity; importzdw.pspgame.game.klActivity; publicclassFragment3extendsFragment{ privateString[]names=newString[]{"科隆方块","最终幻想零式","战神: 斯巴达之魂","怪物猎人P3","火影忍者疾风传究极冲击","铁拳6"}; privateString[]descs=newString[]{"游戏容量: 56mb","游戏容量: 1.03G","游戏容量: 1.03G","游戏容量: 1.03G","游戏容量: 1.03G", "游戏容量: 1.03G"}; privateString[]kinds=newString[]{"益智类","角色扮演","动作类","动作类","动作类","格斗类"}; privateint[]imageIds=newint[]{R.drawable.kl,R.drawable.ff0,R.drawable.gw,R.drawable.mhp3,R.drawable.na, R.drawable.tk6}; @Override publicvoidonCreate(BundlesavedInstanceState){ //TODOAuto-generatedmethodstub super.onCreate(savedInstanceState); } @Override publicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){ //TODOAuto-generatedmethodstub Viewview=inflater.inflate(R.layout.tab3,container,false); finalList for(inti=0;i Map listItem.put("header",imageIds[i]); listItem.put("personName",names[i]); listItem.put("desc",descs[i]); listItem.put("kind",kinds[i]); listItems.add(listItem); } SimpleAdaptersimleAdapter=newSimpleAdapter(getActivity(),listItems,R.layout.simple_item, newString[]{"personName","header","desc","kind"}, newint[]{R.id.name,R.id.header,R.id.desc,R.id.kind}); ListViewlist=(ListView)view.findViewById(R.id.mylist); list.setAdapter(simleAdapter); list.setOnItemClickListener(newOnItemClickListener(){ @Override publicvoidonItemClick(AdapterView >arg0,Viewarg1,intarg2,longarg3){ if(listItems.get(arg2).get("personName").equals("怪物猎人P3")){ Intentintent=newIntent(); intent.setClass(getActivity(),mhp3Activity.class); startActivity(intent); } if(listItems.get(arg2).get("personName").equals("科隆方块")){ Intentintent=newIntent(); intent.setClass(getActivity(),klActivity.class); startActivity(intent); } } }); returnview; } } Fragment4.java packagezdw.pspgame; importcom.mozillaonline.downloadprovider.R; importandroid.content.Intent; importandroid.os.Bundle; importandroid.support.v4.app.Fragment; importandroid.view.LayoutInflater; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.view.ViewGroup; importandroid.widget.ImageView; importzdw.pspgame.theme.theme_net; importzdw.pspgame.theme.theme_setting;
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- PSP 游戏 中心 软件 代码