tag:blogger.com,1999:blog-865923359735383241.post6837942520649743862..comments2023-10-29T07:27:09.012-06:00Comments on Ccna final exam - java, php, javascript, ios, cshap all in one: Write applications in C or C++ for Android?Unknownnoreply@blogger.comBlogger20125tag:blogger.com,1999:blog-865923359735383241.post-76976597805598582292012-06-01T22:43:33.253-06:002012-06-01T22:43:33.253-06:00Short answer: You can't.
@Backslash17: Looki...Short answer: You can't.<br /><br />@Backslash17: Looking through the article and the following link with installation instructions, all the company got working is to launch a self compiled executable on the emulator, bypassing the android framework. Once you have the emulator you can telnet in and have a linux shell. Running a linux program there is trivial of course.<br />But that's not working for phones without jailbreak(aka root access) and not deliverable on the market.<br /><br />Unless Google opens other opportunities or someone writes a custom compiler that compiles Language X into Dalvik bytecode (Dalvik is the VM that runs Android programs) you won't be able to write native code.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-61457751048032880272012-06-01T22:43:32.309-06:002012-06-01T22:43:32.309-06:00Native C/c++ Files libstdc++.* from your Ubuntu a...Native C/c++ Files libstdc++.* from your Ubuntu are x86 (or x86_64)<br /> binaries but Android devices and emulators are ARM. Of course, this<br /> will not work anyway, even if you'll set correct soname. This is very<br /> naive way which leads nowhere. Android has very limited support of<br /> C++ meaning there is no exceptions, standard C++ library (including<br /> STL) and RTTI. If you need such functionality, use my custom NDK<br /> distribution from <br /> <br /> http://crystax.net/android/ndk.php - it support full C++ features<br /> listed above. <br /> <br /> Why is there error: undefined reference to '__cxa_end_cleanup' link<br /> error. Android stlport <br /> <br /> time. Because there is no link to libstdc + +. A. So wrong.<br /><br /> Because it uses some static library, it is necessary to link the full libstdc + +. A. Can<br /><br /> <br /> http://crystax.net/android/ndk.php here to download the package<br /> <br /> sources \ cxx-stl \ gnu-libstdc + + \ libs \ armeabi directory.<br /> <br /> Android on its own libstdc + + support is limited, it must be linked<br /> to a complete libstdc + <br /> +. A the job.<br /> <br /> Add file in Android.mk LOCAL_LDFLAGS = $ (LOCAL_PATH) / libs /<br /> libcurl.a \<br /> $ (LOCAL_PATH) / libs / liblua.a \<br /> $ (LOCAL_PATH) / libs / libstdc + +. A And LOCAL_CPPFLAGS + =-lstdc + +-fexceptions can be compiledUserhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-88189224144252550262012-06-01T22:43:31.428-06:002012-06-01T22:43:31.428-06:00This three steps are good to have and store in thi...This three steps are good to have and store in this post.<br /><br />1) How to port native c code on android<br /><br />2) http://www.integratingstuff.com/2010/12/12/calling-native-c-code-through-jni-in-android-applications/<br /><br />3) http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-91668092581846046682012-06-01T22:43:27.729-06:002012-06-01T22:43:27.729-06:00I do not know a tutorial but a good development to...I do not know a tutorial but a good development tool: Airplay SDK from Ideaworks Labs. (Recently rebranded "Marmelade") Using C/C++ you can build apps for Windows Mobile, iPhones, Android. The only component I didn't like was the GUI composer - a buggy one, but you always can substitute it with the Notepad.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-34675256206601118932012-06-01T22:43:23.935-06:002012-06-01T22:43:23.935-06:00Since 2009 there is a development on this matter.
...Since 2009 there is a development on this matter.<br />Necessitas - Qt(C++ framework) for Android<br />Getting started video.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-66299391061011021192012-06-01T22:43:23.260-06:002012-06-01T22:43:23.260-06:00There is a plan to allow C/C++ libraries in the ne...There is a plan to allow C/C++ libraries in the next SDK version of Android (Codename Eclair?)To date, it's not possible through the Android Java SDK. However, you can grab the HUGE open source project, roll your own libraries, and then flash your own device...but anyone who wants to use your library will have to flash your custom build as well.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-13991374253990001862012-06-01T22:43:22.435-06:002012-06-01T22:43:22.435-06:00This blog post may be a good start: http://benno.i...This blog post may be a good start: http://benno.id.au/blog/2007/11/13/android-native-apps<br />Unfortunately, lots of the important stuff is "left as an exercise to the reader".Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-86139451252950963552012-06-01T22:43:13.017-06:002012-06-01T22:43:13.017-06:00You can download c4droid and then install the GCC ...You can download c4droid and then install the GCC plugin and install to your SD. From the shell I just traverse to the directory where the GCC binary is and then call it to make an on board executable.<br /><br />find / -name gcc<br /><br />/mnt/sdcard/Android/data/com.n0n3m4.droidc/files/gcc/bin/arm-linux-androideabi-gcc<br /><br />cat > test.c<br /><br />#include<stdio.h><br />int main(){ <br /> printf("hello arm!\n");<br />return 0;<br />}<br /><br /><br />./arm-linux-androideabi-gcc test.c -o test<br /><br />./test<br /><br />hello arm!Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-68495177697015163052012-06-01T22:43:12.328-06:002012-06-01T22:43:12.328-06:00Google has already launched Google I/O 2011: Bring...Google has already launched Google I/O 2011: Bringing C and C++ Games to Android session which is available at http://www.youtube.com/watch?v=5yorhsSPFG4<br /><br />which is good to understand the use of NDK for writing application in c and c++ for android.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-27791579511872949072012-06-01T22:43:11.410-06:002012-06-01T22:43:11.410-06:00Maybe you are looking for this?
http://www.mosync...Maybe you are looking for this?<br /><br />http://www.mosync.com/<br /><br />It is a middle layer for developing for several mobile platforms using c++.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-6282674577057458452012-06-01T22:43:10.313-06:002012-06-01T22:43:10.313-06:00I'm not sure the NDK provides full coverage of...I'm not sure the NDK provides full coverage of the official Java API.<br /><br />From http://developer.android.com/sdk/ndk/index.html#overview :<br /><br /><br /> Please note that the NDK does not<br /> enable you to develop native-only<br /> applications. Android's primary<br /> runtime remains the Dalvik virtual<br /> machine.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-75390408584714828342012-06-01T22:43:07.997-06:002012-06-01T22:43:07.997-06:00Google just released the NDK which allows exactly ...Google just released the NDK which allows exactly that.<br /><br />http://feedproxy.google.com/~r/blogspot/hsDu/~3/2foWz7hwFtE/introducing-android-15-ndk-release-1.html <br /><br />It can be found here:<br />http://developer.android.com/sdk/ndk/1.5_r1/index.htmlUserhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-22260797489456118812012-06-01T22:43:05.716-06:002012-06-01T22:43:05.716-06:00Take a look at google ndk group it looks promising...Take a look at google ndk group it looks promising, first version of the NDK will be available in 1H2009.<br /><br />Update:<br />And it is released http://android-developers.blogspot.com/2009/06/introducing-android-15-ndk-release-1.htmlUserhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-32904658096176318562012-06-01T22:43:04.688-06:002012-06-01T22:43:04.688-06:00Normally, you have to:
Install Google Android ND...Normally, you have to:<br /><br /><br />Install Google Android NDK. It<br />contains libs, headers, makfile<br />examples and gcc toolchain<br />Build an executable from your C code<br />for ARM, optimize and link it with<br />provided libs if required<br />Connect to a phone using provided<br />adb interface and test your<br />executable<br /><br /><br />If you are looking to sell an app:<br /><br /><br />Build a library from your C code<br />Create simple Java code which will<br />use this library<br />Embed this library into application<br />package file<br />Test your app<br />Sell it or distribute it for freeUserhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-85164259631965997932012-06-01T22:43:03.678-06:002012-06-01T22:43:03.678-06:00You can use nestedvm to translate C (or other GCC ...You can use nestedvm to translate C (or other GCC languages) into Java bytecode, and use that as the basis of your port. For example, see the Android port of Simon Tathams portable puzzle collection.<br /><br />I expect this method is made obsolete by the NDK, but it might not be in if some networks or something don't allow people to upgrade their phones.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-90866170364809533712012-06-01T22:43:00.182-06:002012-06-01T22:43:00.182-06:00Looking at this it seems it is possible:
http://o...Looking at this it seems it is possible:<br /><br />http://openhandsetmagazine.com/2007/11/running-c-native-applications-on-android-the-final-point/<br /><br />"the fact is only Java language is supported doesn’t mean that you cannot develop applications in other languages. This have been proved by many developers, hackers and experts in application development for mobile. The guys at Elements Interactive B.V., the company behind Edgelib library, succeeded to run native C++ applications on the Android platform, even that at this time there is still many issues on display and sound … etc. This include the S-Tris2 game and a 3D animation demo of Edgelib."Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-23193714446057656512012-06-01T22:42:59.557-06:002012-06-01T22:42:59.557-06:00The official position seems to be that this isn...The official position seems to be that this isn't something you'd ever "want to do". See this thread on the Android Developers list. Google envisage android running on a variety of different devices (CPUs, displays, etc). The best way to enable development is therefore to use (portable) managed code that targets the Dalvik VM. For this reason, the Android SDK doesn't support C/C++.<br /><br />BUT, take a look at this page:<br /><br /><br /> Android includes a set of C/C++<br /> libraries used by various components<br /> of the Android system. These<br /> capabilities are exposed to developers<br /> through the Android application<br /> framework.<br /><br /><br />The managed application framework appears to be layered on-top of these libraries. The page goes on to list the C/C++ libs: standard C library, media, 3D, SQL lite, and others.<br /><br />So all you need is a compiler chain that will compile C/C++ to the appropriate CPU (ARM, in the case of the G1). Some brief instructions on how to do this are here.<br /><br />What I don't know is where to find descriptions of the APIs that these libraries provide. I'd guess there may be header files buried in the SDK somewhere, but documentation may be sketchy/missing. But I think it can be done!<br /><br />Hope thats useful. For the record, I haven't written any native android apps - just a few simple managed ones.<br /><br />AndyUserhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-55206092949549161592012-06-01T22:42:58.643-06:002012-06-01T22:42:58.643-06:00Google has released a Native Development Kit (NDK)...Google has released a Native Development Kit (NDK) (according to http://www.youtube.com/watch?v=Z5whfaLH1-E at 00:07:30).<br /><br />Hopefully the information will be updated on the google groups page (http://groups.google.com/group/android-ndk), as it says it hasn't been released yet.<br /><br />I'm not sure where to get a simple download for it, but I've heard that you can get a copy of the NDK from Google's Git repository under the donut branch.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-88284168524428301322012-06-01T22:42:57.892-06:002012-06-01T22:42:57.892-06:00You can develop native applications for Android, I...You can develop native applications for Android, I have done some work in that area.<br />The best link for you is Android NDK page.<br />In brief, the easiest way for you would be to use some JNI wrapper to start and navigate your application. For this work, you should can also be using Android compiler that is available along with Android source code. An old alternative is CodeSourcery, but it's better to use the native prebuilt compiler.<br />You will have to use Bionic C-library, and accommodate needs of your application to the existing features in C/C++ on Android. Some Linux IPC is missing, such as System V, but your C/C++ application probably isn't using that anyway.<br />Note that in your research you should avoid articles that refer to older versions of Android SDK. So, avoid all links from 2008. or 2007.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.comtag:blogger.com,1999:blog-865923359735383241.post-28346768663708490832012-06-01T22:42:56.657-06:002012-06-01T22:42:56.657-06:00For anyone coming to this via google, note that st...For anyone coming to this via google, note that starting from SDK 1.6 Android now has an official native SDK. There doesn't seem to be a general page for the 'NDK', but the download page for the first release is here.Userhttps://www.blogger.com/profile/11557173689529910046noreply@blogger.com