一些经验(二)

 adb改文件读写权限

•Once you started the Emulator from one shell, login to another shell & type
•adb shell
•You should see # prompt displayed, this is your device(emulator) shell. Now , type following command at adb shell.
•mount -o remount rw /sdcard
•This will now remount /sdcard with rw(read-write) permission & now you can push your files into /sdcard by using following command from your host shell.
•adb push filename.mp3 /sdcard, where filename.mp3 could be any file that you want to push into Android Emulator.
获取路径
•获取文件路径的方法
•1.绝对路径:/data/data/packagename/files/或getAbsolutePath();
•2.context:context.getFilesDir()+”/filename”;
•缓存目录:/data/data/packagename/Cache/或getCacheDir();
•如果文件过大就不能存放在手机的文件目录,需要存储到SDCard上。
•SDCard目录:/sdcard/或Environment.getExternalStorageDirectory()
•使用SDCard目录前,需要判断是否有sdcard:Environment.getExternalStorageState()。操作此目录时需要在主配置文件中注册操作权限。
播放声音(AudioManager 
播放声音( MediaPlayer  
Vibrate
ESN,IMSI,Telephone
获取输入流经典方法 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值