Claudiu Persoiu

Blog-ul lui Claudiu Persoiu


Archive for the ‘Android’ tag

Android calculator vs. JavaScript

with 2 comments

Is about the phone’s calculator. I have a HTC Desire with Android 2.2. My default calculator app that’s called simply “Calc” amazes me. Very rarely happens to need to use it, end even less I’m using it with fractional numbers, but when I’m actually using it I tend to forget that it has an issue.

Let’s say:

12 – 11

In Calc = 1, in JavaScript = 1. Nothing out of the ordinary so far, right?

Let’s take:

1.2 – 1.1

Any elementary school student knows that the result is 0.1.

In Calc it is 0.099999999, weird? In JavaScript is even more interesting, the result is 0.09999999999999987.

It’s about float, and I assume that the difference comes from the digit number displayed on the screen. In both cases IEEE 754 standard is used.

Now… in JavaScript this is a known issue, but who made the Android app, made it transform to a scientific calculator if you rotate the phone and did not see this issue?

Written by Claudiu Persoiu

3 May 2011 at 10:19 PM

Posted in Diverse

Tagged with ,

PHP for Android a first opinion

without comments

When it comes to Android and PHP a lot has been written about PHP for Android.

The concept is simple, Google launched Android Scripting Environment (ASE).

ASE is as the name suggests, a scripting environment, and the apps are not compiled and they can be modified at all times by the user.

Over ASE there are extensions installed for different languages like: Python, LUA, Perl, JavaScript or JRuby.

Unfortunately there isn’t official support for PHP from Google, but there is PHP for Android, project which allows the integration between PHP CLI and this environment.

The installation is very simple and is done directly on the phone. For development Android SDK simulator can be used.

One of the issues is that the app can’t be packed as an APK, so it can’t be posted on Android Market.

Basically this was the only issue raised so far everywhere, issue that doesn’t seem exactly big considering the facilities available in this environment.

I’ve searched for apps build with PFA, I’ve found only a few, actually I found only a few even in other languages using ASE. Why aren’t the users eager to develop in this environment? Simple, using the scripting environment you can access a lot of facilities of available on the phone, like vibrating for instance and about all the available dialogs. But there is an essential feature which is totally lacking (or at least at the time this blog is written), there isn’t a graphical interface, like any kind of window that isn’t a dialog.

So what is the purpose of adding an app to Android Market if there is no graphic interface? I don’t believe there is almost no real consistent reason at this point.

But what are the developers doing in this environment then? Well Cellbots for instance.Basically you can do some interesting toys, but don’t expect to do real apps (yet). Another project it was sending a NexusOne into space.

So the project is interesting, but I don’t think it has the purpose of developing traditional apps just yet.

Written by Claudiu Persoiu

21 August 2010 at 12:26 PM

Posted in Diverse,PHP

Tagged with , ,

Android for web developers

without comments

Recently I’ve changed my “old” HTC Diamond running Windows Mobile 6.1 with an HTC Desire running Android 2.1.

Why Desire? Mainly for Android. There are 3 platforms out there which deserve attention:¬† iPhone, Android and Windows Mobile. There is Blackberry two, but I’m not a big fan.

Briefly, I’ve chosen¬† Android for the multitude of ways in which you can write an app.

The native language for Android is Java, but for web developers there are alternatives like: Titanium, Phonegap, PHP for Android or Adobe AIR.

I what to explore these alternative technologies to see what and how easy is to develop whit each one of them.

All I can say at the moment is that my first app took me almost 2 days to build, but the result is interesting.

Written by Claudiu Persoiu

12 August 2010 at 9:35 PM

Posted in Diverse

Tagged with