Change Internal Storage Size : Axioo GFI (Jellybean)

Woohooo, a year full no posting even a word…

Ok, here is what we’re waiting for so long: custom partition size for axioo GFI jellybean…

As you know that GFI and GEA from axioo only have 512MB for internal /data, so it’s pretty useless for today apps that need gigs of space, and for internal SD they have much space, 2GB, while it has optional external SDcard! What an awful partition scheme….

So after hexdumping some files from stock JB ROM, I came to the mod to repartition internal SD become 2GB for /data and the rest, 315MB, for /emmc (internal SD), just like the pics below:

I don’t have screenshots for original partition scheme, but I think all of you do not interested knowing it 😀

Basically we need to simple edit EBR1 to change the size of /data and adjust the /emmc partition to suit our need. How?
First we need to know the size of emmc disk (not /emmc!), here I found 3883 MB or rounded to 4GB. Next we need to know the size of each partitions, we doing `df` from adb shell, and the result is: 780M for /system, 512 for /cache and /data. It’s clear why the current mod didn’t work for JB but ok for ICS, because the /system size on JB are much bigger, although the script itself only deals with EBR1 (confused too :D). Then, calculating the total size of /system, /cache and /data, and adjusting only the /data and /emmc in EBR1 file.

To make the long story short, here is the new EBR1 file to flash with sp_flash_tool (First unzip it). Remember to only flash the EBR1.

Don’t forget to wipe/format /data and /emmc from CWM recovery console, reboot and you’re on your own way now…

NB: another tuts hopefully follows… just to make sure that this blog is still alive 😀

Simple Ajax with JQuery and PHP (very quick and dirty tutorial)

Well some dudes asked me how to learn ajax quickly without a lot of hassle by learning XHR and such. So, here is the quick way: use jquery and some simple knowledge of HTML and PHP and you’re done.

First, some HTML(5):

<!doctype html>
<html>
<head><title>Just test</title>
<script type='text/javascript' src='jquery.min.js'></script>
</head>
<body>
What's your name, dude?
<input id='name'>
<input id='send' value='Send' type='button'>
<div id='repson'></div>
<script type='text/javascript'>
$('#send').click(function(){
  $.get('test.php',{data:$('#name').val()},
  function(resp){
    $('#repson').html(resp);
  });
});
</script>
</body>
</html>

As you can see, input elements don’t really need FORM tag, even they don’t need any name assigned, because we’ll send it without form. When we click button ‘Send’, we are sending the name value into PHP script, and display the response from PHP into the ‘repson’ DIV.

Now, for the PHP:

<?php
echo "Hi, ".$_GET{'data'];
echo ", nice to see you around...";
?>

And that’s it all. You’ve done ajax coding! We can then extend the form into fully featured HTML5 form, or using JQuery UI, and we definitely need database operations on PHP side.

MySQL Custom Order

In one of my projects, I need to sort queries based on a custom pre-ordered list, e.g sort query by Indonesian month. Suppose we have a table like this:

id tahun bulan jumlah
1 2011 Jan 100
2 2011 Mar 110
3 2011 Apr 120
4 2011 Jun 110
5 2011 Feb 130
6 2011 Mei 120
7 2011 Jul 110
8 2011 Des 140
9 2011 Sep 120
10 2011 Okt 130
11 2011 Nov 120
12 2011 Agt 150

 

 

 

 

 

 

 

 

 

 

 

 

I want to show the data ordered by bulan in the order of: Jan-Feb-Mar-Apr-Mei-Jun-Jul-Agt-Sep-Okt-Nov-Des. It’s clearly impossible to use direct order by bulan, so we need a work around here. After some googling around, I found a clue in StackOverflow here.

So, based on that answer, I then compiled a new variable on my config.php as below:

$bulans = array(‘Jan’,’Feb’,’Mar’,’Apr’,’Mei’,’Jun’,’Jul’,’Agt’,’Sep’,’Okt’,’Nov’,’Des’);

$order_bln = “ORDER by CASE bulan\n”;

foreach($bulans as $key => $val){

    $order_bln .= ‘WHEN \” . $val . ‘\’ THEN ‘ . $key . “\n”;

}

$order_bln .= “\nEND”;

To use $order_bln in a query is simple, just add it in the end of query variable, like this:

$qry = “select * from stok where tahun=’$tahun’ $order_bln”;

 

Skip to toolbar