计算机软件著作权登记-源代码范本
时间:2026-01-16
时间:2026-01-16
package com.example.shuoya;
import java.util.Set;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.util.Log;
import android.widget.Toast;
public class Breast extends BroadcastReceiver
{
private static final String mACTION = "android.provider.Telephony.SMS_RECEIVED";
@Override
public void onReceive(Context context, Intent intent)
{
// TODO Auto-generated method stub
if (intent.getAction().equals(mACTION))
{
StringBuilder sb = new StringBuilder();
Bundle bundle = intent.getExtras();
if (bundle != null)
{
Set<String> keysSet=bundle.keySet();
for(String keyString:keysSet){
Log.d("key", keyString);
}
Object[] myOBJpdus = (Object[]) bundle.get("pdus");
SmsMessage[] messages = new SmsMessage[myOBJpdus.length];
for (int i = 0; i<myOBJpdus.length; i++)
{
messages[i] = SmsMessage.createFromPdu ((byte[]) myOBJpdus[i]);
}
for (SmsMessage currentMessage : messages)
{
//sb.append("接收到来告:\n");
//sb.append(currentMessage.getDisplayOriginatingAddress());
//sb.append("\n------传来的短信------\n");
sb.append(currentMessage.getDisplayMessageBody());
}
}
Toast.makeText(context, sb, Toast.LENGTH_LONG).show();
Intent i2 = new Intent(context, FuzhuActivity.class);
Bundle bundle2=new Bundle();
bundle2.putString("SMS", sb.toString());
i2.putExtra("SMSS", bundle2);
i2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
}
}
}
package com.example.shuoya;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
public class DbAdapter extends SQLiteOpenHelper{
private static final int VERSION = 1;
private static final String DBNAME = "test.db";
public DbAdapter(Context context, String name,
CursorFactory factory, int version) {
super(context, name, factory, version);
// TODO Auto-generated constructor stub
}
public DbAdapter(Context context,String name){
this(context,name,VERSION);
}
public DbAdapter(Context context){
this(context,DBNAME,VERSION);
}
public DbAdapter(Context context,String name,int version){
this(context,name,null,VERSION);
}
public void onCreate(SQLiteDatabase db) {
// TODO Auto-generated method stub
}
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
System.out.println("update a database");
}
}package com.example.shuoya;
import java.util.List;
import com.example.shuoya.R;
import android.app.AlertDialog;
import android.content.Context;
import android.database.DataSetObserver;
import http://www.77cn.com.cnyoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
import android.widget.LinearLayout;
import android.widget.TextView;
//public class DetailAdapter implements ListAdapter
public class DetailAdapter extends BaseAdapter
{
private List<DetailEntity> coll;
private Context ctx;
DetailEntity entity;
LinearLayout layout;
LayoutInflater vi;
LinearLayout layout_bj;
TextView tvName;
TextView tvDate;
TextView tvText;
public DetailAdapter(Context context, List<DetailEntity> coll)
{
ctx = context;
this.coll = coll;
}
public boolean areAllItemsEnabled()
{
return true;
}
public boolean isEnabled(int arg0)
{
return true;
}
public int getCount()
{
return coll.size();
}
public Object getItem(int position)
{
return coll.get(position);
}
public long getItemId(int position)
{
return position;
}
public int getItemViewType(int position)
} public View getView(int position, View convertView, ViewGroup parent) { entity = coll.get(position); int itemLayout = entity.getLayoutID(); } layout = new LinearLayout(ctx); vi = (LayoutInflater) ctx .getSystemService(http://www.77cn.com.cnYOUT_INFLATER_SERVICE); vi.inflate(itemLayout, layout, true); layout.setBackgroundColor(0xffB4B4B4); layout_bj = (LinearLayout) layout.findViewById(http://www.77cn.com.cnyout_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); return layout; public int getViewTypeCount() { return coll.size(); } public boolean hasStableIds() { return true; } public boolean isEmpty() { return true; } @Override public void registerDataSetObserver(DataSetObserver observer) { // TODO Auto-generated method stub }
public void unregisterDataSetObserver(DataSetObserver observer)
{
// TODO Auto-generated method stub
}