计算机软件著作权登记源代码范本Word格式.docx
《计算机软件著作权登记源代码范本Word格式.docx》由会员分享,可在线阅读,更多相关《计算机软件著作权登记源代码范本Word格式.docx(117页珍藏版)》请在冰点文库上搜索。
String>
keysSet=bundle.keySet();
for(StringkeyString:
keysSet){
Log.d("
key"
keyString);
}
Object[]myOBJpdus=(Object[])bundle.get("
pdus"
);
SmsMessage[]messages=newSmsMessage[myOBJpdus.length];
for(inti=0;
i<
myOBJpdus.length;
i++)
messages[i]=SmsMessage.createFromPdu((byte[])myOBJpdus[i]);
}
for(SmsMessagecurrentMessage:
messages)
//sb.append("
接收到来告:
\n"
//sb.append(currentMessage.getDisplayOriginatingAddress());
\n------传来的短信------\n"
sb.append(currentMessage.getDisplayMessageBody());
Toast.makeText(context,sb,Toast.LENGTH_LONG).show();
Intenti2=newIntent(context,FuzhuActivity.class);
Bundlebundle2=newBundle();
bundle2.putString("
SMS"
sb.toString());
i2.putExtra("
SMSS"
bundle2);
i2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i2);
}
importandroid.database.sqlite.SQLiteDatabase.CursorFactory;
importandroid.database.sqlite.SQLiteOpenHelper;
publicclassDbAdapterextendsSQLiteOpenHelper{
privatestaticfinalintVERSION=1;
privatestaticfinalStringDBNAME="
test.db"
publicDbAdapter(Contextcontext,Stringname,
CursorFactoryfactory,intversion){
super(context,name,factory,version);
//TODOAuto-generatedconstructorstub
}
publicDbAdapter(Contextcontext,Stringname){
this(context,name,VERSION);
publicDbAdapter(Contextcontext){
this(context,DBNAME,VERSION);
publicDbAdapter(Contextcontext,Stringname,intversion){
this(context,name,null,VERSION);
publicvoidonCreate(SQLiteDatabasedb){
//TODOAuto-generatedmethodstub
publicvoidonUpgrade(SQLiteDatabasedb,intoldVersion,intnewVersion){
System.out.println("
updateadatabase"
}packagecom.example.shuoya;
importjava.util.List;
importcom.example.shuoya.R;
importandroid.app.AlertDialog;
importandroid.database.DataSetObserver;
importandroid.view.LayoutInflater;
importandroid.view.MotionEvent;
importandroid.view.View;
importandroid.view.View.OnClickListener;
importandroid.view.View.OnLongClickListener;
importandroid.view.View.OnTouchListener;
importandroid.view.ViewGroup;
importandroid.widget.BaseAdapter;
importandroid.widget.LinearLayout;
importandroid.widget.TextView;
//publicclassDetailAdapterimplementsListAdapter
publicclassDetailAdapterextendsBaseAdapter
{
privateList<
DetailEntity>
coll;
privateContextctx;
DetailEntityentity;
LinearLayoutlayout;
LayoutInflatervi;
LinearLayoutlayout_bj;
TextViewtvName;
TextViewtvDate;
TextViewtvText;
publicDetailAdapter(Contextcontext,List<
coll)
ctx=context;
this.coll=coll;
publicbooleanareAllItemsEnabled()
returntrue;
publicbooleanisEnabled(intarg0)
publicintgetCount()
returncoll.size();
publicObjectgetItem(intposition)
returncoll.get(position);
publiclonggetItemId(intposition)
returnposition;
publicintgetItemViewType(intposition)
publicViewgetView(intposition,ViewconvertView,ViewGroupparent)
entity=coll.get(position);
intitemLayout=entity.getLayoutID();
layout=newLinearLayout(ctx);
vi=(LayoutInflater)ctx
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
vi.inflate(itemLayout,layout,true);
layout.setBackgroundColor(0xffB4B4B4);
layout_bj=(LinearLayout)layout.findViewById(R.id.layout_bj);
tvName=(TextView)layout.findViewById(R.id.messagedetail_row_name);
tvName.setText(entity.getName());
tvDate=(TextView)layout.findViewById(R.id.messagedetail_row_date);
tvDate.setText(entity.getDate());
tvText=(TextView)layout.findViewById(R.id.messagedetail_row_text);
tvText.setText(entity.getText());
addListener(tvName,tvDate,tvText,layout_bj);
returnlayout;
publicintgetViewTypeCount()
publicbooleanhasStableIds()
publicbooleanisEmpty()
@Override
publicvoidregisterDataSetObserver(DataSetObserverobserver)
//TODOAuto-generatedmethodstub
publicvoidunregisterDataSetObserver(DataSetObserverobserver)
publicvoidaddListener(finalTextViewtvName,finalTextViewtvDate,
finalTextViewtvText,LinearLayoutlayout_bj)
layout_bj.setOnClickListener(newOnClickListener()
{
@Override
publicvoidonClick(Viewv)
{
}
});
//实例并初始化TTS对象
layout_bj.setOnLongClickListener(newOnLongClickListener()
publicbooleanonLongClick(finalViewv)
tvName.setTextColor(0xffffffff);
tvDate.setTextColor(0xffffffff);
tvText.setTextColor(0xffffffff);
newAlertDialog.Builder(ctx).setMessage("
说呀聊天辅助系统-应答模式"
).setPositiveButton("
确定"
null)
.show();
returntrue;
////
layout_bj.setOnTouchListener(newOnTouchListener()
publicbooleanonTouch(Viewv,MotionEventevent)
switch(event.getAction())
{
caseMotionEvent.ACTION_DOWN:
caseMotionEvent.ACTION_MOVE:
tvName.setTextColor(0xffffffff);
tvDate.setTextColor(0xffffffff);
tvText.setTextColor(0xffffffff);
break;
default:
tvName.setTextColor(0xff000000);
tvDate.setTextColor(0xff000000);
tvText.setTextColor(0xff0000ff);
}
returnfalse;
publicclassDetailEntity
privateStringname;
privateStringdate;
privateStringtext;
privateintlayoutID;
publicStringgetName()
returnname;
publicvoidsetName(Stringname)
this.name=name;
publicStringgetDate()
returndate;
publicvoidsetDate(Stringdate)
this.date=date;
publicStringgetText()
returntext;
publicvoidsetText(Stringtext)
this.text=text;
publicintgetLayoutID()
returnlayoutID;
publicvoidsetLayoutID(intlayoutID)
this.layoutID=layoutID;
publicDetailEntity()
publicDetailEntity(Stringname,Stringdate,Stringtext,intlayoutID)
super();
importjava.io.BufferedReader;
importjava.io.IOException;
importjava.io.InputStreamReader;
import.URL;
import.URLEncoder;
publicclassFenci{
/*Calledwhentheactivityisfirstcreated.*/
staticStringu="
publicStringstr;
publicstaticStringnlp(Stringfunc,Stringinput){
Stringstr1="
"
try{
input=URLEncoder.encode(input,"
utf-8"
URLurl=newURL(u+func+"
/"
+input);
StringBuffersb=newStringBuffer();
BufferedReaderout=newBufferedReader(newInputStreamReader(url.openStream(),"
));
Stringline;
while((line=out.readLine())!
sb.append(line);
str1=sb.toString();
out.close();
}catch(IOExceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
inti=str1.indexOf("
s"
str1=str1.substring(i+1);
returnstr1;
}
importjava.io.File;
importjava.io.FileOutputStream;
importjava.io.InputStream;
importjava.io.OutputStream;
importjava.util.ArrayList;
importandroid.app.Activity;
importandroid.content.DialogInterface;
importandroid.content.pm.PackageManager;
importandroid.content.pm.ResolveInfo;
importandroid.speech.RecognizerIntent;
importandroid.view.Window;
importandroid.view.WindowManager;
importandroid.widget.AdapterView;
importandroid.widget.AdapterView.OnItemClickListener;
importandroid.widget.Button;
importandroid.widget.EditText;
importandroid.widget.ListView;
importandroid.widget.PopupWindow;
importandroid.graphics.drawable.BitmapDrawable;
publicclassFuzhuActivityextendsActivity
privateListViewtalkView;
list=null;
//menu菜单模块
privatePopupWindowpopupWindow;
privateListViewlv_menu;
privateViewview;
Menus;
privatestaticfinalintVOICE_RECOGNITION_REQUEST_CODE=1234;
privateEditTextmText1;
privateButtonspeakButton;
privateButtonqdButton;
privateButtonchooseButton;
longexitTime=-2000;
publicvoidon