- 浏览: 116036 次
- 性别:
- 来自: 深圳
最新评论
-
icess_ma:
这个需要什么权限吗
Android 在状态栏添加图标的函数
文章列表
private void getWordPageNumber()
{
wordApp = new MSWord.ApplicationClass();
wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
// 打开Word
object FileName = " ...
播放raw中的音乐范例
- 博客分类:
- Android
package cn.test.lee;
import android.app.Service;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.IBinder;
public class MyPlayerService extends Service implements
MediaPlayer.OnPreparedListen ...
public void receive() throws Exception {
Log.e(tag, "receive()");
// sharedpreference读取数据,用split()方法,分开字符串。
SharedPreferences pre = getSharedPreferences("SAVE_INFORMATION",MODE_WORLD_READABLE);
String content = "name;pass";//pre.getString("save", "&qu ...
Intent intent = new Intent(TFNoticeTicketReceiver.ACTION_NOTICE);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent,0);
Calendar calendar = Calendar.getInstance();
AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
alarmManager.set(Alar ...
D:\>keytool -list -v -keystore D:\work\trunk\keystore\matrix.key -storepass 123456
创建可访问https的client
- 博客分类:
- Android
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyE ...
if(StringUtils.IsShowLog) {
try {
ByteArrayOutputStream os=new ByteArrayOutputStream();
byte[] b = new byte[4096];
for (int n; (n = is.read(b)) != -1;) {
StringUtils.logD(tag, ""+new String(b, 0, n));
os.write(b, 0, n);
}
InputStream is_ ...
将保存的文件读为bitmap
- 博客分类:
- Android
private boolean getSavedPngAndSet(ImageView view, String logoUrl) {
String dir = this.getExternalCacheDir().getAbsolutePath();
File rootFileDir = new File(dir);
if(rootFileDir.exists() && rootFileDir.isDirectory()) {
String filename = logoUrl.replace("/&q ...
将bitmap保存为文件
- 博客分类:
- Android
private void saveBmpToSd(Bitmap bm, String url) {
if (bm == null || url==null) {
return;
}
if (10 >freeSpaceOnSd()) {
return;
}
String filename = url.replace("/", "").replace(":", "&qu ...
try {
File f = new File(getExternalCacheDir().getAbsolutePath()+"my.xml");
OutputStream outPut = new FileOutputStream(f);
XmlSerializer serializer=Xml.newSerializer();
serializer.setOutput(outPut, "utf-8");
serializer.startDocument("u ...
private void installApk(){
Log.d("login", "apkFile="+apkFile);
File apkfile = new File(apkFile);
if (!apkfile.exists()) {
return;
}
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse("file://" + apkfile.toString( ...
void readSDCard() {
String state = Environment.getExternalStorageState();
if(Environment.MEDIA_MOUNTED.equals(state)) {
File sdcardDir = Environment.getExternalStorageDirectory();
StatFs sf = new StatFs(sdcardDir.getPath());
long blockSize = sf.getBlockSize();
long blockCount = sf.getBloc ...
Android
系统应用程序
Eclipse
开发环境的搭建
首先
,
将要修改的应用程序
,
从
alps(
源码根路径)\packages\apps
目录下拷贝到本地机子上,然后在Eclipse
新创建一个Android
项目,选择Create project from existing source
引进该应用程序,如图:
<!-- [if gte vml 1]><v:shapetype
id="_x0000_t75" coordsize="21600,21600&qu ...