Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I see the statement below on Google in one form or another
Most of the Android development is Java based because Android supports
a large number of Java libraries
I am coming from Java based web application background. I have never heard the statement "Windows supports one specific language but Linux does not". Then why in context of mobile OS we say android supports Java. The role of any OS is to execute the commands and not to support the specific language, right?
I know I am missing something basic here, but what's that?
Then why in context of mobile OS we say android support java.
I do not know who "we" is. Experienced computer programmers would not say that, and even your made-up quote does not say that.
Role of any OS is to execute the commands not to support the specific language right ?
Correct. And, given a rooted Android device, you are welcome to try porting any language you like to Android, and in a custom ROM mod, you are welcome to arrange to allow the user to run any program they want in any of those supported languages.
However, most people do not have rooted Android devices.
On a normal Android device, the Android frameworks put some limitations on what you easily can use for programming.
For example, you can divide the world of Java-capable servers into two main categories:
Those where you have complete control over the server, which is roughly equivalent to running a rooted Android device
Those where all you can do is upload a WAR and related files (e.g., static assets), which are run on a Java-powered server managed by somebody else
In that latter scenario, you are not going to have complete flexibility in programming. Presumably, you could integrate JVM-based scripting languages, but you may have difficulty in using C++. That is not an issue with the OS — the server itself is probably perfectly capable of running a C++ program. It is an issue of the framework in which your code is running (whatever people use for WARs nowadays, as it has been a long time since I worked in server-side Java development).
The primary framework for Android development is based on Java. Courtesy of WebView, this also opens up hooks for hybrid development (HTML/CSS/JS). NativeActivity makes it possible to write full Android apps in C/C++. Various toolchains allow you to write in other languages (e.g., Kotlin) that compile into something that works with Android's frameworks, and you can embed scripting languages. But you still need to stick to the frameworks, which puts some limits on what you can do and how you can do it. This is not the fault of the Android OS, but rather the frameworks.
Yes, Android is based on Java. But recently the grandpa Delphi acquired fire monkey, which is supposed to transform Delphi code in to native Android code. That way it supposedly run just like a native application.
Related
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 4 years ago.
Improve this question
I started to learn android development in Java and followed that path up to now.
Nowadays there are many cross platforms development languages such as Xamarin, React Native and etc.
I know that I can develop for both iOS and Android in cross platform languages which is usually requested by customers to develop mobile app in these two platforms.
Now my question is what is the benefit for developing in native android and iOS platforms over using cross platform languages?
I think if I have not enough reason to stuck to native development, I could not satisfy my customer to develop their app in native languages and I need to migrate to cross-platform languages.
So I want to know are there any bold benefits for native development or not?
This is one of those endless debates in development. There are so many reasons to go either way.
Native Benefits:
Best possible user experience
Access to all the features of the os and hardware
Smaller and faster applications (especially UI responsiveness)
Often easier to maintain (no need to deal with platform bugs)
Quicker response to o.s. changes
Cross-platform Benefits
Faster development to access the larger user base
Easier development - no need to learn as much about each native system
Powerful integration options (Cloud, Security, Game Engines, etc.)
For involved UI, I suggest that building your UI to target the native platform and everything else to be cross-platform. It is important to understand how important the user experience is to the success of the app you are making. Something simple like accessing some data from the web and showing a chart will look fine in a cross-platform app. Doing advanced image manipulation will likely require native UI to feel right.
The bottom line is "it depends on the project"
It depends on your project requirement to develop native app or hybrid app.
Choose native development if
High performance
You want a fluid, high responsive user interface
The user interface should feel familiar to users on each platform
Your application needs full access to all device hardware and functionality.
Choose cross-platform development if
You want to develop a quick prototype to test and validate a simple concept
Your application has a simple user interface and has limited user interaction, such as listing and showing news content
Your user interface has limited scrolling and swiping and users will not be affected by a sluggish screen response
Your application does not process complex data or work with audio or video
Cross-platform development is not a silver bullet.
Taking decisions about changing from native development to hip frameworks and cross-platform tools, you need to understand specifics of implementing same features in terms of this cross-platform tools. And this can be a problem in itself, because you will need experience with cross-platforming.
Cross-platform tools are cool as in "it will be a single codebase", but in some cases they are not. Different OS means different UI / UX, services and underlining implementations, as they form according APIs. It is baffling to see a React Native project with different set of modules written for specifics of Android and iOS, just to understand that this exact project should have been written as separate native applications all along.
So, before developing, take a quick dive into specific cross-platform tooling you think will be the best and you will understand implications of using this tooling for your project.
So just use Kotlin. Kotlin is interoperable with Java and working with JVM, but also has native compiler for iOS. Of course development for both platforms makes some limits, but if you want to create cross platform application it may be useful for you.
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 4 years ago.
Improve this question
Updated(for clarity and to reduce ambiguity):
I'm going to start tinkering around with android apps. I was planning on writing the in C++ using the NDK (since I have more experience in C++ and prefer it to Java) but came across the following on the Android NDK page:
you should only use the NDK if it is essential to your
app—never because you simply prefer to program in C/C++.
I was under the impression that you should use the language that you prefer, as long as it fits the job. Could somebody explain why it is so heavily advised not to use C/C++ for android development?
Original:
I'm going to start tinkering around with mobile apps, specifically android which is the OS of my current phone, and I was wondering if writing the app in C++ (or at least the core, then wrapping in Java) was an acceptable option.
Some background, I'm a computer science major who has taken 3 C++ courses(intro, intermediate, OOP, and am taking an STL course in the spring) and only 1 Java course(intermediate). Because of this, I am more comfortable with C++ and prefer it to Java. I came across the following on the Android NDK page:
Using native code on Android generally does not result in a noticeable
performance improvement, but it always increases your app complexity.
In general, you should only use the NDK if it is essential to your
app—never because you simply prefer to program in C/C++.
I was under the impression that you should use the language the fits
the job as well as one you're familiar with
I may want to port the application to another mobile platform, such
as iOS, that supports C++ but not java
While Java is a high level language and thus should make development
faster, I feel like development would be slower because I would have
to relearn almost everything (since I have only taken one class on
the language)
Any advice would be much appreciate.
ps: many of the answers on this subject are from years ago and there are very few follow up answers that mention the NDK allowing the development of full native apps on android 2.3 and newer.
Think of it this way. You have the ability using the Java SDK to build a full working application that takes advantage of 100% of the APIs available to developers. There is nothing you can do with the NDK that cannot be done with the SDK (from an API perspective), the NDK just provides higher performance.
Now look at it in reverse. If you choose to write an application 100% in the NDK, you can still write a fully functional application, but you are limited in the number of framework APIs you can access. Not all of the Android framework can be accessed at the native layer; most APIs are Java only. That's not to say that all the APIs YOU may need aren't available in the NDK, but nowhere near ALL the APIs are exposed.
Beyond this, the NDK introduces platform-specific code which expands the size of your distribution. For every device architecture you intend to support, your native code must be built into .so files (one for armv5, armv7 and x86) all packaged up into the same APK. This duplication of executable code makes your app 3x the size (i.e. a "fat binary") unless you take on the task of building separate APKs for each architecture when you distribute the application. So the deployment process becomes a bit more work if you don't want your APK to grow in size significantly.
Again, while none of this is prohibits you from doing what you choose, it points out why Google describes Java as the "preferred" method for the majority of your code and the path of least resistance. I hope it sheds some light on why the documentation is worded the way it is.
If you're only going to develop one app in your life, use the NDK.
If you're aiming at learning Android development with the intention of developing more than one application during your lifetime - and want to be able to properly support them all - you're very likely to do better in the long run if you learn Java and use Android's Java SDK instead.
The programmers at King use C++ for their game logic. And they seem to be doing fine judging by their turnover.
In my experience, C++ is for problem solvers and Java is for problem avoiders. I love either language, but C++ is quite rewarding when you write good code. However, it may just take several moments of wizardry to get there.
You could recommend C++ for Data scientists as well, who would normally get their job done by, say, Python or R. C++ can do the same with as good or not better performance, but it just takes being a genius in the language. That is why I'd never not recommend C++ to the one that wants to do it - I'd just give a heads up to the treat that they're in for.
I found this interesting article from:
http://betanews.com/2014/07/22/why-c-is-the-perfect-choice-for-modern-app-development/
C++ was built specifically for platform independence and as such is found on every single operating system in existence. Your typical mobile user may know that Android apps are written Java and iOS apps in Objective-C, but what many don’t know is that there is more C/C++ code in memory on your devices than anything else. C/C++ drives much of the technology of small devices (like the kernel, which interacts with the hardware, as well as typical run time libraries) and the telecommunications networks that enable these devices. More importantly for a development team, is that there are C/C++ interfaces and libraries for anything you need to do on any device and platform. The Android NDK toolset is a great example of full C/C++ support that was added originally for game development teams to enable them to get the best possible performance out of the device by avoiding Java and the Android Java runtime Dalvik, the virtual machine on which Android Java code is executed on. It has been regularly improved to enable every Android service.
I would say use java for main app. But if you have some c++ code you need to port or some library you need that is efficiently implemented in c++, then use ndk for those bits
I don't see any reason to not use C++ for normal android development , If you have extensive experience in working in C++ and with complex OS like windows or any other such, then you can grasp android quickly and is not as much complicated as the other OS are. while learning java or working without learning it would be more frustrating and complex !
The most important consideration is that the compiled Java code will run on all android devices unchanged, whereas the native code will need to be compiled for all target platforms.
The general intent for both Java and Android is that you write the majority if not all your app in Java and use native things only when there is no other option... so everything about writing the app will lend itself to doing so in Java.
You'll spare yourself a lot of aggravation in bridging between the native and Java worlds by writing in Java.
As well, you will do yourself a big favor if you take the plunge and learn Java. Not only will your Android app be the better for it, but you will expose yourself to a significantly different approach to OO and you will be a better programmer for it.
Add to that the fact that you will side-step a whole bunch of security risks by writing in Java.
In my mind, this is a no-brainer - use Java.
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 8 years ago.
Improve this question
Java is one of the best managed runtime technologies we have. It has very high performance VM which allows to achieve performance close to C. The amount of high quality open source libraries is incomparable to any other platform.
However, despite it was the first dynamic client side technology to appear in browsers (Applets), it isn't used widely now.
What are disadvantages of Java which make people use JavaScript + HTML5 or Flash/Flex instead of Java for RIA? Why should I use them despite they are not as pleasant for a programmer as Java?
"it isn't used widely now"
I disagree with this perception... some examples:
Mindterm is a Java based ssh freeware client supporting ssh2 can be run embedded as applet google for it
Mizu web phone is a Java and open standards based SIP VOIP client which can be embedded as an Applet -google for it-
OpenSignX is an opensource Java based document and form signing Java applet for PKI X.509 certificates. google for it
Coolsmile is a Java based IRC client that can be run as app or embedded Applet
-google for it-
JFTerm is a Java telnet client. Can be run as desktop app or applet. Supports telnet (23), ssl and ssh -google for it-
J3Dworkbench is a Java 3D game-design authoring tool. delivery via Webstart or as Applets
-google for it-
There´s also thevirtualheart dot org a Java based heart simulator
also an applet
or Geocaching browser (JavaFX) at canoo dot com
You cannot do everything in HTML5... for instance take a look at complex apps like JITSI (videocomerencing, voip app) or MuCommander -google it- or Sweet Home 3D, or Art of Illusion... all java-based. Java serves a purpose... and Microsoft and its friends have been trying to discredit it, replace it with something else, and it continues being relevant. ask yourself why. it´s because it serves a purpose and its level playing field software ecosystem is HUGE.
Do a seach of code dot google.com for Java-related projects... and see.
Plus, to the commenter above who says JavaFX has limited appeal let me remind you that Java is NOT ONLY a programming language but actually 3 things: a programming language, a runtime environment, and a level playing field software ecosystem. You can use Java libs without writing a single code of Java language ... using Jython (Python for Java), JRuby (Ruby on Java), NetRexx (open source Rexx on Java, see www.netrexx.org), xRuby (ruby to Java bytecode compiler) or Jabaco (Basic to java bytecode compiler)... just to name a few of the many JVM languages... http://en.wikipedia.org/wiki/List_of_JVM_languages
It can take a lot of work to create a high quality applet compared to the amount of time it takes someone to create a high quality flash application. Building a presentation layer can be tedious without the right tools.
Furthermore, Oracle/Sun gave up on applets a while ago. They still support them but are not actively trying to improve them. Oracle is currently putting all of its weight behind JavaFX. JavaFX is a technically viable solution and has the advantage of allowing you to leverage your Java knowledge. The problem is most web designers don't have much Java knowledge and don't want to bother with it so JavaFX has never been very popular. If a web language isn't popular it can annoy your users when they have to download plugins to use it.
Another thing to keep in mind is that Flash itself is also on the way out. If you're going to be developing and maintaining this project yourself then feel free to pick up JavaFX.
If you plan on hiring a web designer or you want to learn web design skills allowing you to get hired somewhere then your best bet these days seems to be learning a good javascript framework (e.g. JQuery) and picking up some solid HTML5 and CSS3 skills.
Google maps for mobile is a java applet "http://en.wikipedia.org/wiki/Google_Maps#cite_note-20"
I should think that says alot, the question is sort of a truism this prevents a constructive answer the question I'd try to answer is this "is java applets and javaFX widely used" as your question is based on a premise which we cant be sure of how you arrived at it. Java applets work on the web JavaFX on the other hand is more than just for building applets, a GUI isn't just an applet
I can just hope to add to your knowledge and help you re-assess your opinion
the below is from:
http://www.ibm.com/developerworks/web/library/wa-appmozx/
HTML is great for displaying hypertext documents, but terrible for displaying GUIs. Traditional Web-based applications use endless amounts of effort trying to shoehorn HTML into the look-and-feel of a traditional forms-and-menus application. That was never a purpose for which it was intended.
The addition of form elements to HTML (FORM) did little more than create a new way to implement thin-client block-mode applications in the style of the venerable 3270 terminal. Like the 3270, HTML provides batched-up form submission. Character-based applications ultimately gained efficient user-navigation systems, but that was all lost when GUI applications came along. Subsequently GUI applications added back their own navigation structures, using the mouse and widget feedback.
When HTML forms came on the scene, they copied the design of block-mode terminals, but without the tight navigation and without replacing it with a proper GUI equivalent. Under HTML, the user is left to guess which visual elements on a given page might be user controls and which are just decorations. Therefore, for GUI-driven applications, HTML isn't that great a starting point. That's the reason why Java applets were met with such positive market hysteria when they first appeared -- they presented an opportunity to provide a real GUI.
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
I want to start making cellphone apps with Android as first choice but not the only one. I have 10 years of experience with Java, C#, C++ in commercial applications and I know that many things and practices for this applications are not valid for cellphones. Where do I start reading? How do I adapt my way of thinking to this new environment as quickly as posible? I plan to make some money with it sometime in the future as an extra income or a career change maybe, who know. Any resource or advice you could recommend will be very welcome. Thanks in advance.
Just start with Android Developer site http://developer.android.com/index.html.
It contains all you need for the beginning. Also take a look onto Commonsware android books,
those are really great both for beginners and experienced programmers - http://commonsware.com/books.html.
You could start with two great books listed as reference [1] (Ableson F. et al., Unlocking Android, 2009. Manning Publications Co., ISBN 978-1-933988-67-2) and [4] (Conder S. and Darcey L., Android Wireless Application Development, 2009. Addison-Wesley, ISBN 978-0-321-62709-4) in my degree thesis. Both have an extensive walk-through of Android, which you as a developer should know. You'll get all you need from "Hello World" to deploy an actual application in the Android Market.
Android is the place to start, since you already know Java and C# and C++. You can even use native classes in Java written in C or C++ if you have some useful standard classes in your library. More on Natives you'll find in the reference book [9] (Silva V., Pro Android Games, 2009. Apress, ISBN 978-1-4302-2647-5).
The best of luck!
Only support the TOP os's which generate income. So at this moment IOS and Android.
Don't go down the path of Symbian and Java... it's dirty, and you won't like what you see down there.
What really got me going was the Hello, Views documentation. Will really get you up and running instantly.
I recently decided studying Android, and http://developer.android.com was a great resource. You should read the Application fundamentals doc first and User Interface documentations later.
There are some tutorials too.
I read the whole Application fundamentals, and that gave me a good idea of "how to program for Android" since it has its own architecture and environment. Get the idea of Activities, Services, Broadcast Receivers and Content Providers and try to adapt yourself to that structure. Then read about how Tasks work, and later go into UI.
As a subjective opinion, being Android so popular and growing, I don't think it's worth the effort to study Java ME or even C (I'd go for iPhone devel in any case with Objective-C). Android will probably give you more money and faster. Java FX might be interesting...
iPhone
Android
Samsung Bada
I would like to mention that iphone and Android communities are very much evolved and have a great developer community and resources. Samsung Bada doesnt have a good developer network nor does the SDK support many operating systems. I think it works only on Windows.
You need to first understand the mobile platform architecture, the different frameworks which the platform exposes to the programmers to develop applications.
There are emulators for you to test, however you have to have one of those devices to do a real time on-device testing.
With respect to programming, i think your experience is more than enough but one needs to come out of the frame of mind and think differently. A typical device has limited processing power, limited memory, limited screen space but the user demands beats expectations compared to desktop/enterprise software.
Lastly most important thing is the IDEA of the application. You may want to survey existing application on the stores and start thinking. You can also develop and application which would solve your problem with mobile devices and you know other users also may want such a application.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
After I downloaded the Google Mail and Google Maps application into my mobile phone I got an idea about a service that I want to implement.
My problem is that I never did any programming for the mobile platform and I need someone to point me out some resources for the Hello World on a mobile and then something a bit more complicated.
Let's make it a bit broad, as in J2ME in general for the moment. I'll dig into Android once I get the non Android/*Berry/etc out of the way.
Clicking here would be a pretty good place to start, it's where the best J2ME programmers have started before you...
Install NetBeans with J2ME - you can test your mobile applications on a variety of target device emulators. Easy development model - you can develop GUIs rapidly with the Visual Mobile Designer.
I would really recommend looking at Blackberry as a target platform to play with, for the following reasons:
Lots of documentation
Access to cheap devices for testing
No walled garden (approval system or closed marketplace), you can distribute your app via over the air downloads (user just has to point their browser to the appropriate JAD file and download/install begins)
Large user base (at least within the US)
Quality forum support for blackberry developers
Supports J2ME. You can either develop Blackberry specific apps of J2ME specific apps, both run on blackberry devices.
Blackberry specific apps have a more elegent UI library (lots of J2ME witdgets you need to roll your own or use a library like LWUIT) and you won't be able to run Blackberry specific apps to other devices (though the underlying logic will be the same)
Both Blackberry and J2ME specific apps can still access and use underlying non-ui classes of each framework.
The only cons:
Not as sexy as Android or iPhone development
Initial setup can be clumsy
Tough to monetize because no formal blackberry store to manage transactions and installs
You can get more info about Blackberry development here:
http://na.blackberry.com/eng/developers/started/
Starting from Sun's JavaME (former J2ME) website you can find a lot of documentation and examples (even if i must admin, they are a little old).
If you want something more complex yet more advanced, you can have a look at GEAR Java Mobile Framework. It's a lightweight JavaME framework and it's hosted on sourceforge.
There is also a blog containing some usefull tutorial on how to start a new application from scratch.