使用C4droid和botbrew在andriod手机上编程

本文介绍了如何在Android手机上使用C4droid和botbrew进行编程。C4droid是一款C/C++ IDE,需要手机root权限,支持GCC、SDL和Qt。botbrew则是一个开源工具,可以安装多种软件,如gcc、python等,通过chroot进入debian环境。文章还分享了两个使用C4droid编译运行的示例程序源代码。
摘要由CSDN通过智能技术生成

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

               

简单介绍如何安装使用C4droid和botbrew,以及如何在手机上用它们编写运行程序。
注意:
  1:C4droid和botbrew都需要手机拥有root权限才可以正常运行。
  2:本文章绝不提供任何破解程序的下载!

 

  Author       : He YiJun  (storysnail<at>gmail.com QQ:363559089)
  Develop Team : 7fane Team
  Editor       : Yang QiuXi
  Art Designer : He YiJun
  License      : 7fane Team  License 1.0
  Last Update  : 2013-03-09

 

 

 

一:使用C4droid

 

  1:
    到google play搜索C4droid,然后下载安装,现在最新的版本是3.98,当然这么好的软件一定要收些费用的,目前的价格是¥18.61。安装好C4droid点图标运行,它会提示要下载gcc、sdl、QT的插件,按照提示到google play下载和安装。
  2:
    c4driod自己的介绍文档,是英文的,很简单也比较全面,懒得翻译了,自己看吧!
C4droid is a C/C++ IDE + C/C++ compiler for Android with GNU Makefile, SDL and Qt support. C4droid supports devices with ARM processors only (not devices with Intel x86 or MIPS processor).
You can create your own applications on Android phone, run them (even without Internet access: compiler is offline) and export executables (for terminal apps) or APK (for apps with GUI usage). This app uses TCC and uClibc (or GCC with Bionic libc with a plugin), so it has full support of ANSI C and ISO C99. C4droid can be used for educational purposes or to practice in C/C++ language.
C4droid supports syntax highlighting, code completion and source code formatting, so it is a very handy tool for programming on the go.

 

To get C++ support you need:
0) Enough internal memory OR root rights. C4droid doesn't require root rights for devices with more than 50MB of free internal memory.
1) Install GCC plugin (C4droid will ask you to install it).
2) Select G++ compiler in C4droid preferences.
3*) Use iostream, not iostream.h
4*) Add "using namespace std;" to your program (before int main)

 

C4droid contains a Terminal Emulator with BusyBox, so you can use Makefiles without any changes, shell commands syntax is the same as on Linux PC.
To compile Makefile projects, open any file in the same folder with Makefile and long-click "Compile" to configure current directory (C4droid will create .c4droid configuration file when you'll press Ok). After configuring folder, you can press compile button and C4droid will build your project.
Don't forget to enter executable name and select compilation mode (and press ok also, else changes will be discarded)

 

C4droid supports SDL, NativeActivity and Qt for GUI now, install SDL plugin for C4droid to use it (only GCC/G++ compiler is supported, so you need GCC plugin).
(SDL is detected with #include "SDL.h", NativeActivity is detected with #include "android_native_app_glue.h", Qt is detected with #include "QtGui").
There is an experimental support for Qt using necessitas, but note that it's in alpha stage.
Qt support limitations:
1) Path to Ministro libraries is hardcoded (/data/data/org.kde.necessitas.ministro/files/qt/lib), so email me if it will change.
2) If you're compiling a single-file Qt app, you must add #include "yoursourcefilenamewithcpp.moc" to the end of file. If you're using .pro file for compilation, you don't need to do that.

 

Quick manual:
If you have found a bug or app is not working, email me.

 

Long click actions:  长按某一按键会有第二功能
Save button: save as.
Open button: recent files.
Run button: run with arguments.
Compile button: configure current directory.
Tab: close tab.

 

Result of compilation (binary or APK) can be exported using menu->export.
If you have "Illegal instruction" error, using internal compiler (TCC), install GCC plugin, GCC supports softfloat (by default).

 

C4droid will che

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值