I think that we are slowly getting used to the fact that most people do most of their work now on non-desktop devices. In fact, on a recent trip away, my laptop stopped charging and I was left to look after server management and a few database bugs on nothing but tablet and phone. Thanks to 4G for that one!
However, as mobile devices (including tablets) become more ubiquitous, this means that developers are having to learn new skill-sets or broaden existing talent. The following information is just a quick summary of information and opinions that I am forming with regard to mobile development.
Choices
When you take on a new project for mobile devices, the first thing that you are likely to have to decide from a programmatic point of view is whether to have a single code base or to write more natively for each device.
To explain: iOS uses the increasingly popular Objective-C as a native language. Whereas Android uses Java. I'm not sure about Blackberry as I have never had any one ask for an app, however, it seems as though c++ would probably be the language of choice for that. The benefit is that you can write straight for the intended operating system and will have full access to the SDKs and APIs that make development easier on those platforms. At present, for the scale of apps that I develop, this is the weapon of choice for me.
Alternatively, you can write non-native code that accesses the APIs indirectly. Perhaps the best example that caught my eye was Xamarin, primarily because it allows you to write code in c#. The obvious benefit is the re usability of code. The write once, use anywhere syndrome that made Java popular. Other companies do have similar libraries (another notable c# entry is DevExpress).
So the question is, why do I still use native code rather than cool 3rd party frameworks that allow you to write a common set of libraries?
Firstly, cost is a big thing. A lot of these libraries ask for large lump sum payments and/or subscriptions. When developing, I am rather scrooge like and will try to get anything that I can for free before I go to the paid option.
Secondly, I am quite thick and I found that with the small amount of time that I have spent on learning native languages vs learning c# for Xamarin or DevEtreme, I actually progressed quicker learning a new language. I find that the Data Access and common tasks are far more simple to learn from the docs of the native languages and I really love the MVC way that Objective-C utilizes! (but that's for another post me-thinks).
Finally, I have bad experiences with write once libraries. Without going too deeply into the reasons (again another post's job), I have found that there are a lot of issues and bugs that you simply don't get in native libraries that transfer to non-native libraries. This is certainly true of desktop equivalents and I have found similar sentiments regarding the mobile libraries that has put me off for now. What I really don't want is to be promised a write once scenario only to have to continually put "if" statements or other conditional branching for each operating system. I actually would prefer to write it all again (but with the logic already in mind) than to do that.
Again, this post is highly subjective and some of you may find different scenarios work for you than what I have outlined above. If you have any comments, please feel free to comment below and tell me where I am wrong.
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Wednesday, 12 March 2014
Tuesday, 3 July 2012
Equals or ==?
So Android is pretty ubiquitous now. New tablets/phones coming out with the version 4 upgrades and awesomeness. I personally love my Android phone. No, it's not expensive, but I love it!
However, this is where I get to moan. I have never really touched Java before Android came out. Some people swear by it, I swear at it! It's not that Java is an aweful language, in fact there are some really nice features. However, from a C# point of view it is somewhat like learning Polish after learning Russian.
You see the slavic languages are very similar. The have a similar verb conjugation and many similar verbs, and then you get to the important bit, the verb that is the difference between like and love and it lets you down and changes. (Russian love transliterated is "lubit" in Polish lubic is to like).
The same thing happened with Java. I'm feeling confidant in the fact that I can write code without looking up syntax just because it's SO similar to C#. So much so that when i evaluated two variables with a
if(var1 == var2) { // Do Something... }
statement, saw in debugging that they had the same value I expected that the // Do Something... code would run. WRONG! Turns out that the == in Java is COMPLETELY different to C#!
"EEEJIT!" you say. "Java is a better and older language than C#"
"No need to be rude!" Say I "C/C++ is an even older an more widely known langauge than even Java"
So how do we get around this evilness? Why does this happen?
Java-Samples states : "the equals( ) method compares the characters inside a String object. The == operator compares two object references to see whether they refer to the same instance"
So the equals() method was what I needed. Tbh I had not been so dissapointed by a language inconsistancy since the lack of switch in python. I look forward to comments and suggestions (clean ones please) about what I'm missing in Java that makes it better than either C# and/or Python.
However, this is where I get to moan. I have never really touched Java before Android came out. Some people swear by it, I swear at it! It's not that Java is an aweful language, in fact there are some really nice features. However, from a C# point of view it is somewhat like learning Polish after learning Russian.
You see the slavic languages are very similar. The have a similar verb conjugation and many similar verbs, and then you get to the important bit, the verb that is the difference between like and love and it lets you down and changes. (Russian love transliterated is "lubit" in Polish lubic is to like).
The same thing happened with Java. I'm feeling confidant in the fact that I can write code without looking up syntax just because it's SO similar to C#. So much so that when i evaluated two variables with a
if(var1 == var2) { // Do Something... }
statement, saw in debugging that they had the same value I expected that the // Do Something... code would run. WRONG! Turns out that the == in Java is COMPLETELY different to C#!
"EEEJIT!" you say. "Java is a better and older language than C#"
"No need to be rude!" Say I "C/C++ is an even older an more widely known langauge than even Java"
So how do we get around this evilness? Why does this happen?
Java-Samples states : "the equals( ) method compares the characters inside a String object. The == operator compares two object references to see whether they refer to the same instance"
So the equals() method was what I needed. Tbh I had not been so dissapointed by a language inconsistancy since the lack of switch in python. I look forward to comments and suggestions (clean ones please) about what I'm missing in Java that makes it better than either C# and/or Python.
Labels:
android,
c#,
casserly,
development,
equals,
java,
phlog,
programming,
python
Tuesday, 1 May 2012
Android Programming - Yes I know it's Java!!

The first thing that struck me with Android development is Java. I could not believe that I was being forced in to such an unusually bloated language for such a small device. However, I instinctively feel that the guys behind it must have a much better undestanding than me so, let them get on with it. The interesting thing is that it is not a standard JVM but rather runs on the Dalvik VM.
So I decided to go for the new kid on the block Intellij Idea as an IDE. I looked into the Eclipse, and didn't much like it. I installed and almost immediately went with Intellij and haven't looked back. I realize this is subjective, however, I don't care! ;-)
The second thing I learnt was that you need to have a kettle handy for the first time you run the emulator. Closely related is the fact that you never want to close the emulator until you are sure that you are done debugging. This is somewhat due to the fact that the time it takes for the emulator to load the first time is comparable to my grandmother crossing the road, walking up the stairs and putting a brew on for me!
But when you get past all of that, I was really impressed with the layout tools, the xml resources and how easy they were to use, the simple differences between activities, services and broadcast receivers and how they all fit together with the Java language. (it nearly turned me to Java for desktop apps but not quite!) Everything by default is well layed out in the various folders and I feel that I automatically know where I should look for changes to be made after only a day looking into it, and I am no master by any stretch.
A few more interesting features took my eye (and it is possible that these are IDE specific):
[1] Awesome debugging and logging in the Android tab
[2] Git support (oh yes!!!!)
[3] The DDBM (Dalvik Debug Monitor) has Emulator control where you can call the phone. Great for the app I am writing and also for feeling that you have friends without having to talk to them on the phone!!
[4] Good support network. I can't belive that in the relatively short time that Android has been about, I can find someone else somewhere who has done, is trying to do, will do something that I am trying to do and documented it online (go to love Google for that). This is something that even Python and C# have not yet managed despite the slightly longer life they have led.
So all in all, I really like programming for the Android and would recommend it to anyone! Programming is fun again!! Actually it was always fun but now we have an emulator which means that debugging is more interesting for my long-suffering wife :-)
Subscribe to:
Posts (Atom)