给Android应用开发者的十个建议

2011年12月5日

尽管现在Android智能手机和平板电脑的运行速率越来越快,但开发者仍需牢记,应用的运行环境仍受到电池和处理器等诸多资源的限制。以下是如何为应用“瘦身”的十条建议,以便能在当前和以后的所有Android设备都能运行出最佳效果。

1)首先要有良好的编码习惯

一个优秀的开发者应该善于运用常识、完善的算法和标准设计模式。要有资源意识,打开了就要记得关闭,尽量做到晚获取,早释放。这些由来已久的编码准则同样适用Android应用开发,尤其是使用基础设备服务时。
阅读这个条目剩下部分 »

install Android Ice Cream Sandwich on a Samsung Nexus S

2011年11月22日

1. Download the custom ROM

Hit up XDA-Developers and download the Nexus S custom ROM (v2, “no need for wifi patch”). If you have a 4G Nexus S, you can download the appropriate custom ROM, but we haven’t tested it — so be careful.

Once the zip file is downloaded, transfer it to your phone’s SD card.

 

2. Root your phone and install ROM Manager

ROM Manager

If you’re already using CyanogenMod (which hopefully you are), your phone will already be rooted and have ROM Manager installed. Otherwise, you’re going to have to root your phone. This isn’t particularly hard, but it is a multi-step process, and there’s a risk that you could brick your Nexus S. The best way to do this is to follow a video guide, but googling for “how to root nexus s” works as well.

With ROM Manager installed, open it up and make sure the latest version of the ClockworkMod recovery image is installed (“Flash Clockwork Mod Recovery” — see right).

3. Make a backup!

Scroll down in ROM Manager and select “Backup Current ROM.” This will back up all of the system and app data on your phone — but not any data on your SD card, such as photos or music. This backup is saved on your phone’s SD card, in the “clockworkmod” directory — and once it’s done, you should copy this to your computer via USB. You will need this backup if you want to restore your phone to its pre-ICS state.

Installing ICS on your Nexus S should not affect the contents of your SD card, but it’s always wise to make a copy of your photos and videos, just in case. To do so, plug your phone into a computer and transfer the files via USB.

Please bear in mind that installing this build of ICS will completely wipe out your installed apps.You can reinstall them, but you will lose all of your settings. You shouldn’t proceed unless you really want to try out Ice Cream Sandwich. Remember, though, that you should be able to restore your backup without issue — so you do have a way out.

4. Install Android 4 on your Nexus S

ROM Manager, wipe data and cache

Now, from ROM Manager, hit “Install ROM from SD Card,” and surf to the zip file on your SD card (“ics-crespo-aosp-4.0.1-v2-unsigned.zip” or similar). Select “Wipe Data and Cache” and “Wipe Dalvik Cache” from the menu and press OK (see right).

ICS will now install. Your phone will reboot, and in about 60 seconds you’ll be greeted by Ice Cream Sandwich’s phone setup screens, and then some basic tutorials.

Welcome to Ice Cream Sandwich! This build is pre-rooted, so to revert to Gingerbread you will simply have to re-install ROM Manager and restore your backup..

 

国内rom传送:

http://115.com/file/cljnf2ks#

 

(转)区分Activity的四种加载模式

2011年04月25日

转自:http://marshal.easymorse.com/archives/2950

在多Activity开发中,有可能是自己应用之间的Activity跳转,或者夹带其他应用的可复用Activity。可能会希望跳转到原来某个Activity实例,而不是产生大量重复的Activity。

这需要为Activity配置特定的加载模式,而不是使用默认的加载模式。

阅读这个条目剩下部分 »