Categories

Archives

Acer A1 in Hong Kong (Fifth Android phone in HK)

Acer A1 is the 5th android phone here in Hong Kong, with HTC Magic, HTC Hero, Samsung Galaxy and HTC sense. The first network carrier is CSL and the promotion page is http://1010.hkcsl.com/jsp/whats_hot/news_and_promotions/acer_liquid.jsp?language=eng.

Here in HK HTC Hero is making some noise, but network carriers has a huge problem of not updating their customer to the latest OS and i bet they don’t care. I know someone who happen to learn how to update the OS by themself coz their network won’t do that. Now i want to see how CSL would live up to their android customers.

Since HK has laws that phone can’t be locked to a network unlike most country, phones by default are more expensive in the end even if you subscribe to a network. Acer A1 is requires you to have 18 months contact with $218+15 (around 30US) and you have to pay 1500HKD for the device plus the fact that the internet is not unlimited, while this might not sound that much to some, my G1 (dev phone) is under China Mobile using Edge/GPRS but i’m paying 110HKD (15USD) per month. And i download podcasts on my G1 therefore i use gigabytes of data and imagine how much my bill will be if switch to use A1 on CSL. Now since HK has no locked carrier, i’ll try to see if how much will the phone be without the promo (not the listing price).

Transaction on CakePHP when using Oracle


Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3643

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3643

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3651

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3651

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3654

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3654

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3643

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3643

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3651

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3651

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3654

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3654

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 1925

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 1925

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 2290

Warning: implode() [function.implode]: Argument must be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3242

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3265

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3265

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3306

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3357

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3357

Warning: array_keys() [function.array-keys]: The first argument should be an array in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3502

Warning: Invalid argument supplied for foreach() in /home3/monmonja/public_html/almondmendoza/wp-content/plugins/devformatter/geshi/geshi.php on line 3502

Following my post on http://monmonja.com/blog/2008/07/transaction-on-cakephp-12/ where i use CakePHP and MySQL to do transaction, now i’m using oracle and $this->Model->begin() is not working and the fix for that is

  |  copy code |? 
1
$this->Model->begin();
2
$returnQuery = $this->Model->getDataSource()->query($query);
3
if($returnQuery !== false){
4
	$this->Model->getDataSource()->commit();
5
}else{
6
	$this->Model->getDataSource()->rollback();
7
}

Hope this helps

How to download on Google Chrome Extensions Gallery on Mac

On Mac right now extensions are disabled by default even if you update to beta and dev channel it would be the same and https://chrome.google.com/extensions has just been launched for windows and this is not fair. So i look for solution on the web and cant find anything so i decided to try it on my own. Cutting to the real chase, the solution is:

** Please use this at your own risk and im not responsible for anything
1) According to http://googlechromereleases.blogspot.com/2009/12/dev-channel-update_04.html revision [r33490] had disabled extensions on Mac due to Issue: 29086 (which is something, disabled the whole extensions over some extensions not being able to install) therefore we have to rollback to Chromium before revision 33490, thus pointing us to r33481 of Chromium, download chrome-mac.zip.

2) After downloading the zip file, unzip it. I saved mine under /Users/mendozaalmond/Downloads/chrome-mac/ (change mendozaalmond to your profile name), you will see one item inside named Chromium

3) Open terminal (Applications -> Utilities -> Terminal) and type
“/Users/mendozaalmond/Downloads/chrome-mac/Chromium.app/Contents/MacOS/Chromium” –user-agent=”Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.30 Safari/532.5″

4) Goto https://chrome.google.com/extensions and install.

Hope this helps :)

Chrome OS and why its here

I lot of people over the weeks had been hyping around Google’s new OS, Chrome OS, while a lot would say that its not a Windows killer the question remains does it need to be one? Here are my opinion on why Google would release Chrome OS when Android is winning over hardware manufacturers.

1) Chrome OS was build for developers and everything else is a bonus
Google, with a lot of interviews stating that within their company they want their developers to think of/with/in the web, now I believe they are pushing this idea out to the developer world. While a lot will argue that the web is not a great application platform, yes it might but it soon will be, like any technology at first they are not better then their predecessors but they evolve and they became better, now the question is how long.

2) Chrome OS is a driver to the linux world
Ever wonder why Ubuntu team worked to make Chrome OS possible? One of the biggest disadvantage of using Linux is looking for drivers to your hardware, usually you will use drivers build by hardcore programmers, while some of them do work, most of the time official drivers are better. Unlike Canonical, Google has the power to influence hardware manufacturers and software company alike to make drivers. Canonical I believe sees a better future with an OS from Google that runs in x86 than seeing it as a stab in Ubuntu, while Chrome OS might not help with software wise, I believe its not using X, hardware wise it will be a big help to the linux world.

3) Chrome OS will combine with Android in a special way
Chrome OS will target x86, Android will target ARM, now this might not make sense to a lot of people especially when Google is rephrasing it as Chrome OS is for the netbooks and Android are for phones, core OS programmers know that making OS for the 2 architecture are different thus having 2 teams are just logical. Now this is where Google Go language will make a big impact in combining them, Google Go is pushin dynamically typed language like Python on a C/C++ code programming style, Android uses Java syntax then compiles it to dalvik which is Python. While Go generates C code as its output, how hard is it for Google to compile something to dalvik or dalvik to C code. And Google has proven that they can use a language’s syntax and compile them to whatever they want as long as they make the programmer/developers feel like they are using their home language, (Java with Android to dalvik, Java with GWT to javascript, C/C++ with Go to c code, javascript with O3D to 3d on the web (something would do with C/C++/C#) ).

When i said in a special way and mention Go language, I would imagine plugins maker. Adobe makes flash, flash is used in a lot of sites (yes it sucks big time especially linux), now making 2 flash players for both OS be a headache for Adobe. In order for plugin makers like Adobe to jump into one of them Google must provide a platform on where they would just have to do it once and they could employ it on both world and Go seems to be the right answer. Let us also remember that Go outputs in c code thus the output could be run with other distribution with lesser code changes.

While everything here is just a pure opinion on my part, I believe that Chrome OS is here, will be here and will stay here in the IT world and it will do something that a lot of us didn’t see it coming and thus it will bring excitement to the IT world.

TTS Extension on Chrome

Firstly this a prove of concept that TTS can be pure web based.

When i was starting with Android the first time I did was Talking Caller that involves TTS, now history repeats itself, while this is not my first chrome extension (Twitter Search Header Fix) this is the first one that has more than 3 lines of code therefore its more considered to be a real extension.

Download:
http://monmonja.com/chrome-experiments/tts.crx

More info at Monmonja Labs – HTML5 – TTS

Relaunching Monmonja Labs

After few weeks of developing it, finally each the point where I could relaunch it, Monmonja labs showcase most of my pass works and current side project/s. The site is done using app engine, using app engine patch. Most of my free time would be divided into Monmonja labs and Android, on some occasion might do some on But I Want To Watch It.

Head over Monmonja labs

Calling private methods in Android

First and foremost, I won’t be held responsible for the content of the article if applied to your apps, and if it results in any kinds of misfunctions and such. Use it at your own risk and use it when there’s are no other way that is available in android.

In java, there is a set of API called Reflection API, see this for more detailed look and this for examples. What Reflection does is that it will, from its name, reflect the class for you, reflecting public, private, protected, static and even native variables, function/methods, classes and more. By getting their reflection you could execute private functions or get private class. In this article however, will focus on calling private methods on a public class. We would use SmsManager and test it on Android 1.6 throughout this article.

Update:
1- There is a bug on the emulator, i tested this on G1, sendRawPdu is missing on the reflection

 Java |  copy code |? 
01
try {
02
	// the following would just be (but using reflections)
03
	// sm.sendTextMessage("<your number>", null, "Test", null, null);
04
 
05
	// initialize variables
06
	SmsManager sm = SmsManager.getDefault();	
07
	Class<?> c = sm.getClass();
08
 
09
	// debug, print all methods in this class , there are 2 private methods in this class 
10
	Method[] ms = c.getDeclaredMethods();
11
	for (int i = 0; i < ms.length; i++)
12
		Log.d("ListMethos",ms[i].toString());
13
 
14
	// get private method 1
15
	Method m1 = SmsManager.class.getDeclaredMethod("createMessageListFromRawRecords", List.class);
16
	Log.d("success","success getting sendRawPdu");
17
 
18
	// get private method 2
19
	byte[] bb = new byte[1];
20
	Method m2 = SmsManager.class.getDeclaredMethod("sendRawPdu",bb.getClass(),bb.getClass(),
21
			PendingIntent.class,PendingIntent.class);
22
	Log.d("success","success getting sendRawPdu");
23
 
24
	// send message
25
	m2.setAccessible(true);
26
	SmsMessage.SubmitPdu pdus = SmsMessage.getSubmitPdu(  null,"<your number>", "Test", false);
27
	m2.invoke(sm, pdus.encodedScAddress, pdus.encodedMessage, null, null );
28
 
29
	Log.d("success","success sedding message");
30
} catch (SecurityException e) {
31
	// TODO Auto-generated catch block
32
	e.printStackTrace();
33
} catch (NoSuchMethodException e) {
34
	// TODO Auto-generated catch block
35
	e.printStackTrace();
36
} catch (IllegalArgumentException e) {
37
	// TODO Auto-generated catch block
38
	e.printStackTrace();
39
} catch (IllegalAccessException e) {
40
	// TODO Auto-generated catch block
41
	e.printStackTrace();
42
} catch (InvocationTargetException e) {
43
	// TODO Auto-generated catch block
44
	e.printStackTrace();
45
}

Explanation
Get the private method from the SmsManager class having one argument of List
Method m1 = SmsManager.class.getDeclaredMethod(“createMessageListFromRawRecords”, List.class);
– From our trace: D/ListMethos( 2900): private java.util.ArrayList android.telephony.SmsManager.createMessageListFromRawRecords(java.util.List)

Get another method from SmsManager that has 4 argument
Method m2 = SmsManager.class.getDeclaredMethod(“sendRawPdu”,bb.getClass(),bb.getClass(), PendingIntent.class,PendingIntent.class);
– From our trace: D/ListMethos( 2900): private void android.telephony.SmsManager.sendRawPdu(byte[],byte[],android.app.PendingIntent,android.app.PendingIntent)

Make the private function to be public
m2.setAccessible(true);

Call the method m2(sendRawPdu) on SmsManager object with the following parameters
m2.invoke(sm, pdus.encodedScAddress, pdus.encodedMessage, null, null );

Basically thats it :) Hope this helps and remember limit the use of this, its not recommended by all means :)