As mentioned in one of my previous articles, usually when you are trying out a different platform or language you try to find the analogy of what you done in your “yesterdays” programming language in regards to the new one.
One such cool analogy, as I see it, is the analogy of web’s POST & GET methods to the Androids “Intent” mechanism. Strange as it might seem, but I find those two pretty similar. Let me elaborate.
In web you have these forms with various input fields trough which you gather user data an submit them (via POST or GET) to some script. Usually this results in you ending up on the different page that was rendered based on the logic that handled the data you inputed on the previous page.
Recently I became proud owner of HTC Desire mobile device powered by Android platform. This is something I got my boss Tomislav Bilic to thank to. Even before (several weeks before) getting my real Android powered phone, I started poking around Android platform. Behind this interest was my desire is was/is to do mobile eCommerce apps. As I have been involved in everyday Magento development for the last two years now, it was only logical for my first steps to do something Magento-Android related.
Switching from one programming language to another usually means checking up on few basic things and trying to replicate code functionality from one language to another. For those of you in the PHP world like me that are trying to start the Android development here is a brief look on how foreach loop can be done in Android (Java).
Recently I have been engaged in Android development. Most of my work is focused on Magento-Android related app. This PHP to Android step actually means PHP to Java (with some sugar on top of it).
Although there are significant difference between Java and PHP, personally I find Java pretty easy. Most likely due to my past experience with C# language. Anyhow, lets get back to the topic of this post “From PHP to Android, the simple stuff – What about arrays”.