Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm looking into porting an application called ygopro (source code here) to Android. I was just wondering if anybody can help me out by telling me what would be the best way to go about doing this? I would prefer to not spend more than about 60 hours on it and I certainly don't have the time to go through and rebuild everything from scratch. The code is in C++ and there are about 5,500 Lua scripts to do various things. Is there any easy way I can port this?
First, you'll note that the graphics library used by this project is based on has been ported to android.
There are two demos available for that project. Those will show you how to write an android application that uses this library. I suggest you essentially hack your projects source into the framework they provide.
In terms of Lua, again you'll want to use an existing port. Many of the Lua ports are oriented towards allowing access to LUA from Java via JNI, but you just want a Lua shared library out of them to link to from your C++ code. You will probably want something like AndroLua rather than the Android Scripting Environment. Pretty much, add all the folders in it's jni folder to your Android.mk includes, add it as a library, and you'll be good to go.
In terms of actual porting, I'm assuming that the project currently compiles happily under GCC. If that is the case, as you try to build it, it will complain about functions that are platform specific, and you will have to replace these. That should be manageable, if you are slowly adding code to the graphics framework demo as suggested. Beyond that, some libc functions are missing, but generally only rarely used ones.
Hope this helps. It goes without saying that you should complete some Android Native tutorials before starting. This project is more than a weekend.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Doing some investigation on the feasibility of using QT/QML for an upcoming project. Client wants it initially on Windows and Mac desktops, with the possibility of iOS and Android down the road. They would like to know that what we build will move relatively easily. I'm not much of a desktop programmer, but what I see is that QML is designed to work with C++. As a result, it should be relatively easy to build an app that runs on Mac and Windows, and iOS will accept C++, so I can't see a lot of roadblocks there. But I'm confused about Android. I see folks talking about building an Android app using QML, but they seem to still be using java; I gather it uses the NDK in the background.
But if you write an application that has QML for the front and, and C++ for any guts not covered by QML, can it work on Android? Or do you need to rewrite the C++ piece in java? The app is not a simple one, so we are going to have to provide some logic outside of QML, at least, it sure looks that way. While we might save time and $$$ by using QT to not have to go native on the desktops and iOS, I see a problem with Android down the road.
But if you write an application that has QML for the front and, and C++ for any guts not covered by QML, can it work on Android? Or do you need to rewrite the C++ piece in java?
It really depends. You may need to go through the Java interface where the Android platform does not provide direct and public API for certain functionality. One example is low-level IO operations, like writing the serial port for usb-serial devices, but there is more to it.
In general, what Qt modules and third-party software based on Qt do is to use the QAndroidExtras add-on module introduced in Qt 5.2. This will allow easy backend integration into your C++ logic.
With that in mind, you could hide the Java implementation details in the background while you still maintain the C++ interface to QML. Therefore, it should just work that way.
Please see the following documentation to get the grasp of it:
Qt Android Extras
Here you can find one of those nice examples:
Qt Notifier - Demonstrates calling Java code from an Android application.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm new to iOS/Android development so I would like to know what is the usual practice of developing an app for different platforms - is the whole code rewritten or the possibilities are used to choose some language, C or C++ for example, and keep most of the work in this language and then cover it with system specific stuff in corresponding language? I know about Android NDK and having C/C++ code in your iOS app, but the question is - is this usually used in practice - maybe later some other platforms might be added? The classical example would be the Angry Birds, of course, which I have even on my "smart" TV. Would be good to hear guys experienced in this area since I might be in the middle of making a decision. Thanks!
You should go check out the Xamarin studio. It allows you to write code in C# and reuse up to 80% of your code between the platforms. They have some videos and tutorials for how to best write code that can be reused.
You might try Qt framework as it's native to Symbian, officially ported to Android, and unofficially ported to iOS and Blackberry. It's a C++ IDE at http://qt.nokia.com
Better yet, if you're into that kinda thing, try PhoneGap here: http://phonegap.com/ This will allow you to write your "app" code in HTML.... yes, HTML, and port it to just about anything. Things that are normally OS-dependent are basically wrapped in PhoneGap's API including hardware: http://phonegap.com/about/feature/
THe classical example would be angry birds? I've either hit a time warp to 20 years in the future, or you're thinking way too small.
But yes, it is quite common to write the majority of logic in C or C++ and just write system specific stuff and/or UI in the native language.
There are several cross-platform solutions on the market. Some of them use Java and C#, they usually are integrated with the common SDKs (such as Visual Studio, Eclipse). Some of them allow to easily develop and distribute web-apps using HTML5, Css3 and jQuery combination.
You can just surf for them on the net. I suppose it's not allowed to mention them here. If I'm wrong I will post the name of some of the most known solutions that I tried.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I'm going to develop an application for iPhone (iOS) and Android. It should run as a unix daemon gathering data and send it using a TCP/IP socket.
We already have a c socket util written in Windows. My thought is to OS cross compile for BSD and Linux and then use it on iOS and Android.
Ive looked a bit at "Android NDK" and guess it should work on Android.
Would that be possible on iPhone iOS or can it only be done in Objective-C?
In case of a GUI layer "on top" of the daemon - would it make sense to reuse the c socket util and the use Objective-C and Java for iOS and Android respectively - with some kind of communication between.
Finally, I prefer c++ - is that possible on iOS also?
First of all, Android code is written in Java so you are just making your life hard by writing your daemon in C. If you look in Android Fundamentals you will see that it is straightforward to have a part of your application that runs as a service.
IOS is even more restrictive than Android because it does not support Java at all. However you might be able to do what you need using XMLVM to compile Java for the iPhone. If your server is not very complex it would probably be easier to just rewrite it in Objective C.
You can call C/C++ code directly from Objective-C code on iOS. It's even easier to integrate C/C++ code on iOS than on Android, where you need a very syntax specific JNI layer between Java and C++.
I would say that C/C++ is MORE native on iOS than on Android. C/C++ files can be added directly to the XCode project, and will be compiled with CLANG.
I am adding this as an answer because I believe the other answer to be mostly wrong, including the comments underneath it.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Is there a Haskell interpreter (with standard libraries) that can be installed on Android?
So that someone with an Android device can do some Haskell exercises on an Android device: write and run some example code in Haskell.
Hugs is written in C and quite portable. It should be possible to port it to Android.
Taking a note from imz, all you need is
ConnectBot or similar
A remote machine with
Vim, Emacs, or similar
runghc / ghci / hugs / yourfavoritehaskellinterpreterorcompiler
It's not as solid as a dedicated app or scripting layer would be, but honestly, for your use cases, it would provide almost exactly the same functionality as those options (if not more). And it would be just as "mobile" as a website (depends only on the uptime of the host and the connectivity of the client).
You can use tryhaskell.org from your mobile browser. It will accept any valid expression, but keep in mind that defining your own data types won't be possible.
For some negative information, all the work I've seen for GHC on Android (such as http://ipwnstudios.com/) is based on cross-compilation, rather than building GHC for android or ARM.
I just found IDEone in the Android Market, which sends your code to an online service. It works, but programming on Android isn't much fun. Btw: In case you don't want to register see BugMeNot
Surprisingly, I couldn't uncover any existing Haskell interpreter for Android.
But here are some instructions for writing your own interpreter for the Scripting Layer on Android. That's assuming you're willing to try mapping the haskell functions on top of the Java android ones (which is not a perfect solution, I know). You'll also want to refer to their scripting layer written for Scala, because that's the one that comes closest to Haskell (which is not very close I admit).
Otherwise, there shouldn't be any reason why any of those Haskell implementations couldn't be directly compiled for Android using the NDK. As long as they're written in C, they should work on Android. For C++, that's a little bit more tricky since Android doesn't have all the C++ headers.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am trying to break into a bit of development and have been advised Ruby is quite an easy / powerful language to get started on.
My main hope for learning a programming language was to break into mobile development. I have heard Ruby can be used for Android development with the right 'kit' but is this a practical language to use for this or will it end up being a more long winded approach than just learning Java from the get go?
I recently read about Ruboto. You should check it out too!
Maybe you should be looking at http://rhomobile.com/?
Almost all the documentation on android development is focused on Java, and eclipse. While I'm not a big fan of Eclipse as an IDE (bloat); it is what the lot use, so it is what I use.
Where you'll find hardship with ruby is when you have to do something that is atypical.. something that is purely android. It will save you time in the beginning, however as with all high level languages, it will end up costing you more when you need to get "dirty"... The net result will be the same.
I program ruby/rails during my day job and android for my "unpaid". Both are good languages, but there are strings attached with any language.
Keep in mind also that the Android platform is Java supported.. In this you know if there are new features in OS 5..6..n then you can be sure there is a way to access them in Java. Ruby might be quick to integrate them, but then it depends on the developers (us) of Ruby. Also keep in mind that on some older devices 1.x..2.x there may be things that run slow when passed through ruby. (I don't know how it's interpreter works)..
Last note. If you learn Ruby for android, and you apply for a job programming Android, I'm betting they will expect Eclipse/Java not xxx/Ruby
Not very sure of Ruby , but you can surely use JRuby http://code.google.com/p/jruby-for-android/
If your goal is to learn mobile development on Android, I would highly suggest sticking with Java. The Android SDK is Java based, and the majority of documentation and examples (including the official docs) you find will be in Java.
While Ruby is a powerful language, it is primarily used for web development. You may have a difficult time finding documentation, and support when you're not using standard Android language.
It appears that Google mainly supports using Java with Eclipse. While you probably could do it with Ruby, I think your best bet is to just use Java and Eclipse.