- 浏览: 1505682 次
- 性别:
- 来自: 南京
文章分类
- 全部博客 (419)
- XMPP (19)
- Android (180)
- Java (59)
- Network (4)
- HTML5 (13)
- Eclipse (9)
- SCM (23)
- C/C++ (4)
- UML (4)
- Libjingle (15)
- Tools&Softwares (29)
- Linphone (5)
- Linux&UNIX (6)
- Windows (18)
- Google (10)
- MISC (3)
- SIP (6)
- SQLite (5)
- Security (4)
- Opensource (29)
- Online (2)
- 文章 (3)
- MemoryLeak (10)
- Decompile (5)
- Ruby (1)
- Image (1)
- Bat (4)
- TTS&ASR (28)
- Multimedia (1)
- iOS (20)
- Asciiflow - ASCII Flow Diagram Tool.htm (1)
- Networking (1)
- DLNA&UPnP (2)
- Chrome (2)
- CI (1)
- SmartHome (0)
- CloudComputing (1)
- NodeJS (3)
- MachineLearning (2)
最新评论
-
bzhao:
点赞123!
Windows的adb shell中使用vi不乱码方法及AdbPutty -
wahahachuang8:
我觉得这种东西自己开发太麻烦了,就别自己捣鼓了,找个第三方,方 ...
HTML5 WebSocket 技术介绍 -
obehavior:
view.setOnTouchListenerview是什么
[转]android 一直在最前面的浮动窗口效果 -
wutenghua:
[转]android 一直在最前面的浮动窗口效果 -
zee3.lin:
Sorry~~
When I build "call ...
Step by Step about How to Build libjingle 0.4
Basic setup
First, it's important to make sure the regular Android development system is set up.
cd /path/to/android/root
make
Important: You will still be using make
to build the files you will actually run (in the emulator or on a device). You will be using Eclipse to edit files and verify that they compile, but when you want to run something you will need to make sure files are saved in Eclipse and run make
in a shell. The Eclipse build is just for error checking.
Eclipse needs a list of directories to search for Java files. This is called the "Java Build Path" and can be set with the .classpath
file. We have a sample version to start you off.
cd /path/to/android/root
cp development/ide/eclipse/.classpath .
chmod u+w .classpath
Now edit that copy of .classpath
, if necessary.
Increase Eclipse's Memory Settings
The Android project is large enough that Eclipse's Java VM sometimes runs out of memory while compiling it. Avoid this problem by editing the the eclipse.ini
file. On Apple OSX the eclipse.ini file is located at
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini
Memory-related defaults (as of Eclipse 3.4):
-Xms40m
-Xmx256m
-XX:MaxPermSize=256m
Recommended settings for Android development:
-Xms128m
-Xmx512m
-XX:MaxPermSize=256m
These settings set Eclipse's minimum Java heap size to 128MB, set the maximum Java heap size to 512MB, and keep the maximum permanent generation size at the default of 256MB.
Now start Eclipse:
eclipse
Now create a project for Android development:
-
If Eclipse asks you for a workspace location, choose the default.
-
If you have a "Welcome" screen, close it to reveal the Java perspective.
-
File > New > Java Project
-
Pick a project name, "android" or anything you like.
-
Select "Create project from existing source", enter the path to your Android root directory, and click Finish.
-
Wait while it sets up the project. (You'll see a subtle progress meter in the lower right corner.)
Once the project workspace is created, Eclipse should start building. In theory, it should build with no errors and you should be set to go. If necessary, uncheck and re-check Project Build Automatically to force a rebuild.
Note: Eclipse sometimes likes to add an import android.R
statement at the top of your files that use resources, especially when you ask eclipse to sort or otherwise manage imports. This will cause your make to break. Look out for these erroneous import statements and delete them.
When You Sync
Every time you repo sync, or otherwise change files outside of Eclipse (especially the .classpath), you need to refresh Eclipse's view of things:
-
Window > Show View > Navigator
-
In the Navigator, right-click on the project name
-
Click Refresh in the context menu
Adding Apps to the Build Path
The default .classpath
includes the source to the core system and a sample set of apps, but might not include the particular app you may want to work on. To add an app, you must add the app's source directory. To do this inside Eclipse:
-
Project > Properties
-
Select "Java Build Path" from the left-hand menu.
-
Choose the "Source" tab.
-
Click "Add Folder..."
-
Add your app's
src
directory. -
Click OK.
When you're done, the "source folder" path in the list should look like
android/packages/apps/YOURAPP/src
Depending on which app(s) you include, you may also need to include othersrc/main/java
directories under android/dalvik/libcore
. Do this if you find you cannot build with the default set.
Eclipse formatting
You can import files in development/ide/eclipse
to make Eclipse follow the Android style rules.
-
Select Window > Preferences > Java > Code Style.
-
Use Formatter > Import to import
android-formatting.xml
. -
Organize Imports > Import to import
android.importorder
.
Debugging the emulator with Eclipse
You can also use eclipse to debug the emulator and step through code. First, start the emulator running:
cd /path/to/android/root
. build/envsetup.sh
lunch 1
make
emulator
If the emulator is running, you should see a picture of a phone.
In another shell, start DDMS (the Dalvik debug manager):
cd /path/to/android/root
ddms
You should see a splufty debugging console.
Now, in eclipse, you can attach to the emulator:
-
Run > Open Debug Dialog...
-
Right-click "Remote Java Application", select "New".
-
Pick a name, i.e. "android-debug" or anything you like.
-
Set the "Project" to your project name.
-
Keep the Host set to "localhost", but change Port to 8700.
-
Click the "Debug" button and you should be all set.
Note that port 8700 is attached to whatever process is currently selected in the DDMS console, so you need to sure that DDMS has selected the process you want to debug.
You may need to open the Debug perspective (next to the "Java" perspective icon in the upper-right, click the small "Open Perspective" icon and select "Debug"). Once you do, you should see a list of threads; if you select one and break it (by clicking the "pause" icon), it should show the stack trace, source file, and line where execution is at. Breakpoints and whatnot should all work.
Bonus material
Replace Ctrl with the Apple key on Mac.
Ctrl-Shift-o | Organize imports |
Ctrl-Shift-t | load class by name |
Ctrl-Shift-r | load non-class resource by name |
Ctrl-1 | quick fix |
Ctrl-e | Recently viewed files |
Ctrl-space | auto complete |
Shift-Alt-r | refactor:rename |
Shift-Alt-v | refactor:move |
Eclipse is not working correctly, what should I do?
Make sure:
-
You followed the instructions on this page precisely.
-
Your Problems view doesn't show any errors.
-
Your application respects the package/directory structure.
If you're still having problems, please contact one of the Android mailing lists or IRC channels.
发表评论
-
[Android] 为Android安装BusyBox —— 完整的bash shell
2013-12-27 10:19 1492http://www.cnblogs.com/xiaowen ... -
Windows的adb shell中使用vi不乱码方法及AdbPutty
2013-12-27 10:17 7587http://www.veryhuo.com/down/ht ... -
AppMobi推出新XDK,可创建测试PhoneGap项目
2012-09-03 13:39 2638AppMobi今天发布了一个新的工具PhoneGap Mobi ... -
Sencha
2012-09-03 12:59 1186http://www.sencha.com/ Se ... -
jQuery Mobile学习
2012-09-01 12:33 1692使用Jquery Mobile设计Android通讯录 ... -
BackBone
2012-09-01 12:34 1262Backbone.js 是一种重量级javascript M ... -
jQTouch
2012-08-30 15:57 985A Zepto/jQuery plugin for mobil ... -
SwiFTP
2012-08-30 15:43 1308SwiFTP is a FTP server that run ... -
kWS
2012-08-30 15:41 1200kWS is a lightweight and fast W ... -
jQuery Mobile
2012-08-30 15:07 1029http://jquerymobile.com/ -
PhoneGap
2012-08-30 15:07 1046http://phonegap.com/ -
Android Button background image pressed/highlighted and disabled states without
2012-08-06 12:49 1682http://shikii.net/blog/android- ... -
[AndriodTips]Image, saved to sdcard, doesn't appear in Android's Gallery app
2012-08-04 16:15 1161http://stackoverflow.com/questi ... -
Voice detection for Android
2012-07-23 11:39 2353Here it is, my fist JAVA applic ... -
[AndroidTip]local reference table overflow (max=512)的错误解决
2012-07-22 22:56 6054JNI层coding经常会遇到ReferenceTable o ... -
[AndroidTip]EditText如何初始状态不获得焦点?
2012-07-22 15:35 1227最简单的办法是在EditText前面放置一个看不到的Linea ... -
[AndroidTip]android textview滚动条
2012-07-21 14:29 1300本来是想做一个显示文字信息的,当文字很多时View的高度不能超 ... -
Google公布Android 4.1完整功能
2012-07-16 09:48 3187http://www.android.com/about/je ... -
Android开发:使用AudioTrack播放PCM音频数据【附源码】
2012-07-13 15:20 20873http://www.linuxidc.com/Linux/2 ... -
Android上的行车记录仪
2012-07-11 22:31 2010MyCar Recorder DailyRoads
相关推荐
Android-android-dev-bookmarks.zip,android开发书签(adb)-android用于cn dev now:https://rocko.xyz/categories/android-dev-bookmarks/;android-dev-bookmarks/;android:https://tinyletter.com/rocko:,安卓...
软件:Dev-Cpp 5.11 TDM-GCC 4.9.2 这个软件我相信大部分人都认识 Dev-C++是一款C++开发工具 Dev C++也是一个Windows下的C和C++程序的集成开发环境 但大家应该遇到这个问题 在访问Dev-Cpp下载的网站: ...
标题中的"Dev-Cpp-5.11-TDM-GCC-4.9.2-Setup.exe"和描述中的"Dev-Cpp_5.11_TDM-GCC_4.9.2_Setup.exe"指向的是同一款软件的安装程序,名为Dev-Cpp,这是一个集成开发环境(IDE),专门用于编写C++语言的程序。...
Dev-C++主页: https://devcpp.gitee.io Dev-C++ (或者叫做 Dev-Cpp)是 Windows 环境下的一个用于 C 语言和 C++ 语言程序设计的轻量级免费集成开发环境。 它集成了 SynEdit 源码编辑器、MinGW-w64 编译器、GDB 调试...
Dev-Cpp 5.11 是一款经典的C和C++集成开发环境,也被称为Dev-C++。这款轻量级的IDE特别适合初学者和专业开发者使用,它集成了编译器、调试器和其他必要的工具,使得C和C++程序开发更为便捷。在2020年5月发布的这个...
`webpack-dev-server` 是 Webpack 提供的一个本地开发服务器,它极大地提高了前端开发效率,因为它提供了实时重载(live reloading)和热模块替换(hot module replacement)等功能。 **实时重载(Live Reloading)...
Dev-Cpp 5.11 TDM-GCC 4.9.2 是一款专为Windows用户设计的强大C/C++集成开发环境(IDE),它在2024年进行了更新,以提供最新的功能和优化。这款软件是编程爱好者和专业开发者进行C++编程的理想选择,因为它集成了...
Dev-Cpp是由Embarcadero公司提供的一款集成开发环境(IDE),特别针对C++编程语言。这个6.3版本是该软件的最新迭代,旨在为开发者提供一个高效、易用的平台来编写、编译和调试C++代码。Embarcadero在软件行业内有着...
《Dev-C++:一款强大的C++集成开发环境》 Dev-C++是一款经典的开源C++集成开发环境(IDE),尤其适合初学者和专业人士进行C++编程。这个标题"Dev-Cpp_5.11_TDM-GCC_4.9.2_Setup.exe"暗示的是Dev-C++的一个特定版本...
Dev-cpp 6.0 Dev-C++是一个C&C++开发工具,它是一款自由软件,遵守GPL协议。它集合了GCC、MinGW等众多自由软件,并且可以取得最新版本的各种工具支持,而这一切工作都是来自全球的狂热者所做的工作,并且你拥有对这...
标题中的"dev-sidecar.rar"指的是一个压缩文件,其核心是一个名为"dev-sidecar"的程序或工具。根据描述,这个工具被设计为一个“上网助手”,特别针对开发者,能够加速对GitHub的访问,并解决在浏览过程中可能出现的...
《Dev-Cpp v5.11 TDM-GCC 4.9.2:一款轻量级C++集成开发环境》 Dev-Cpp是一款经典且小巧的C++集成开发环境(IDE),尤其适合初学者和对资源占用有严格要求的开发者。这个版本,即Dev-Cpp v5.11,内置了TDM-GCC ...
devc 安装包 Dev-Cpp 5.9.2 TDM-GCC 4.8.1 Setup
**Dev-Cpp 5.4.0 MinGW 4.7.2 Setup** 是一个针对C和C++编程语言的集成开发环境(IDE),专为初学者和专业开发者设计。这个版本结合了Dev-Cpp IDE与MinGW编译器套件,其中MinGW是Minimalist GNU for Windows的缩写,...
Dev-Cpp是一款经典的C++集成开发环境(IDE),特别适合初学者和专业开发者进行C/C++编程。这个软件是开源的,因此它是免费的,同时因其用户友好的界面和丰富的功能,深受许多程序员喜爱,特别是在蓝桥杯等编程竞赛中...
相比于其他大型IDE,如Visual Studio或Eclipse,Dev-C++的安装文件小,占用系统资源少,可以在各种配置的计算机上流畅运行,这对于那些资源有限的用户来说是一个巨大的优势。 该软件集成了TDM-GCC编译器,这是GCC...
Ubuntu dev-sidecar deb安装包 DevSidecar-1.7.3.deb
Dev-Cpp 5.6.0 MinGW 4.8.1 Setup.exe Dev-Cpp 5.6.0 MinGW 4.8.1 Setup.exe Dev-Cpp 5.6.0 MinGW 4.8.1 Setup.exe Dev-Cpp 5.6.0 MinGW 4.8.1 Setup.exe
标题中的“gtk-dev-2.12.9-win32-2”指的是GTK+开发工具包的一个特定版本,适用于Windows 32位操作系统。GTK+(GIMP Toolkit)是一个跨平台的图形用户界面(GUI)工具包,广泛用于创建美观且功能丰富的应用程序,...
Dev-C++是一个Windows环境下C&C++开发工具,它是一款自由软件,遵守GPL协议。它集合了GCC、MinGW32等众多自由软件,并且可以取得最新版本的各种工具支持。Dev-C++是一个非常实用的编程软件,多款著名软件均由它编写...