Chinaunix首页 | 论坛 | 博客
  • 博客访问: 131382
  • 博文数量: 24
  • 博客积分: 1685
  • 博客等级: 上尉
  • 技术积分: 257
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-26 12:29
文章分类

全部博文(24)

文章存档

2014年(2)

2013年(1)

2011年(2)

2010年(10)

2009年(6)

2008年(3)

我的朋友

分类: Android平台

2011-05-19 13:47:01

命令行让Android播放音乐

插tf卡开机之后,运行 gdb shell
am start -n com.android.music/com.android.music.MediaPlaybackActivity -d /sdcard/jmzcg.mp3
这个命令可以让android播放TF卡中的MP3


安装Ubuntu之后,安装仓库中的java

在源列表 /etc/apt/sources.list 末尾 添加如下源  
deb http://security.ubuntu.com/ubuntu hardy-security main multiverse
然后 sudo apt-get update
sudo apt-get install sun-java6-jdk

OR

Refers to

Install

Once the download has completed extract it into the /opt directory. To do this open a new root terminal and run the following commands:

# cd /opt
# tar -xzvf /jdk-7u3-linux-x64.tar.gz

Debian already has a pattern for managing different software versions on the same system. This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:

# update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_03/bin/java 1
# update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_03/bin/javac 1
# update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_03/jre/lib/amd64/libnpjp2.so 1
# update-alternatives --set java /opt/jdk1.7.0_03/bin/java
# update-alternatives --set javac /opt/jdk1.7.0_03/bin/javac
# update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_03/jre/lib/amd64/libnpjp2.so

That’s it!

Test

To see which version of Java you are now running by default, execute the following command from a terminal:

# java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) 64-Bit Server VM (build 22.1-b02, mixed mode)


在Ubuntu中安装GCC 4.4 ,并且设置4.4为默认版本

Install GCC 4.4

First, install GCC 4.4 (and friends):

apt-get install gcc-4.4 g++-4.4 g++-4.4-multilib gcc-4.4-multilib

Set 4.4 to be the default

Then set 4.4 to be higher priority than 4.6:

update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 50
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 100
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 50
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4 100
update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 50

Verify that it has worked:

gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.6-11ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.6 (Ubuntu/Linaro 4.4.6-11ubuntu2)



0.Confirm your Gigabit Ethernet verison root@Alan-dell-14R-Turbo:~# lspci | grep Ethernet 03:00.0 Ethernet controller: Atheros Communications Inc. AR8161 Gigabit Ethernet (rev 10) 1.Download Driver Package. sudo su - #input your password wget 2.Uncompress files and exec commands. tar xvf compat-wireless-2012-03-12-p.tar.bz2 cd compat-wireless-2012-03-12-p ./scripts/driver-select alx make make install ./scripts/alx-enable atl1c ./scripts/alx-enable alx modprobe alx ifconfig # You will see some information like this root@Alan-dell-14R-Turbo:~# ifconfig eth1 Link encap:以太网 硬件地址 5c:f9:dd:xx:xx:xx inet 地址:192.168.1.102 广播:192.168.1.255 掩码:255.255.255.0 inet6 地址: fe80::5ef9:ddff:fe3d:8c91/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1 接收数据包:151919 错误:0 丢弃:0 过载:0 帧数:0 发送数据包:86314 错误:0 丢弃:0 过载:0 载波:3 碰撞:0 发送队列长度:1000 接收字节:224592215 (224.5 MB) 发送字节:6266739 (6.2 MB) 中断:16 lo Link encap:本地环回 inet 地址:127.0.0.1 掩码:255.0.0.0 inet6 地址: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 跃点数:1 接收数据包:581 错误:0 丢弃:0 过载:0 帧数:0 发送数据包:581 错误:0 丢弃:0 过载:0 载波:0 碰撞:0 发送队列长度:0 接收字节:54360 (54.3 KB) 发送字节:5436k0 (54.3 KB) root@Alan-dell-14R-Turbo:~#ping PING (74.125.71.105) 56(84) bytes of data. 64 bytes from hx-in-f105.1e100.net (74.125.71.105): icmp_req=1 ttl=52 time=261 ms 64 bytes from hx-in-f105.1e100.net (74.125.71.105): icmp_req=2 ttl=52 time=264 ms




Debian 7 不能安装ia32-libs

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs


二. 无法更新和下载androidSDK
打开SDK Manager时底部进度条一直不动,打开详细信息,发现卡在:
1
Fetching
解决办法:
修改hosts文件。
(1)windows下打开C:\Windows\System32\drivers\etc,以管理员身份编辑hosts文件,在最后添加:
74.125.237.1 dl-ssl.google.com
(2)linux下使用命令sudo vim /etc/hosts编辑hosts文件,同样在文件最后添加
74.125.237.1 dl-ssl.google.com
然后重新运行sdk manager,就可以下载了。


阅读(2920) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~