Nugroho's blog.

Wednesday, June 11, 2014

The Impressions

So, after tinkering with Lenovo A3000 for 5 day...

The IPS screen is acceptable

The quadcore processor is doing what it supposed to do, fast enough

Getting used with android onscreen keyboard ( it's my 1st android device, i used iPhone and iPad), no AZERTY layout tough

 

The Playstore is fairly equal to AppStore. Keep in mind on android open source and open community nature, there's many apps that similar each other, and in some case, apps that has no purpose or simply didn't work.

The treasure (for me) is AIDE, an IDE app to create android app from inside android itself; something that's forbidden in iOS, :)

No home button is definitely problem for me, as it's replacement for my 2 years son's broken iPad. The challenge is how to teach him to use power button to waking up the device. The other solution is set the timeout display to 30 minutes and risk on fast drained battery.

Still give it a chance and time, .....

(My iPad is practically dead brick now, couldn't be charged, got the message like "couldn't charge with this accesories" or "this acessories not support charging" even with new original cable ; it's likely the connector is short circuited and blown away)

(edit: "Charging is not supported with this accessory")


Create Android Application (Thermometer Converter) on Android Itself, using AIDE

It my early android apps developed using Eclipse and ADT on my Mac and now ported to AIDE on my A3000, which is, say, just copy and paste, :).

The app itself consist of two button, one textview, one edit text and a spinner. The input in edit text is processed based on spinner value and the result is displayed on text edit. The button is just for checking and have fun, :)

That's it, now let's get our hand dirty...


Of course the first step is open AIDE apps, :)

 then scroll down until "For Expert" choice appear, I didn't bother to use tutorial, you may like it though, :)
 choose "Create new Project here", then choose "New App"

 Fill the form
 here my main.xml on res/layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/tulisan"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="This is a simple two button app. \r\n \r\n Tell your user what your app does here \r\n \r\n \r\n \r\n"
android:textColor="#005500" />

<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10"
android:ems="10" >
<requestFocus />
</EditText>
<Spinner
android:id="@+id/sprOperator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/sprSuhu"
/>

<Button
android:id="@+id/buttonStart"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Start"/>
<Button
android:id="@+id/buttonStop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Stop"/>
</LinearLayout> 
 


here my strings.xml on res/value
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ThermometerPram</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string-array name="sprSuhu">
<item >C</item>
<item >F</item>
<item >R</item>
<item >K</item>
</string-array>
</resources>



 ..and my MainActivity.java on src/com/nugnux/thermoaide
package com.nugnux.thermoaide;

import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.view.View.OnClickListener;

public class MainActivity extends Activity
{
private static String logtag = "TwoButtonApp";//for use as the tag when logging
private static String text = "belum di pilih";//for use as the tag when logging
private static int pilihan = 0;//for use as the tag when logging
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Spinner spinner = (Spinner) findViewById(R.id.sprOperator);
final String sprSuhu[] = getResources().getStringArray(R.array.sprSuhu);
ArrayAdapter adapter = ArrayAdapter.createFromResource(this,
R.array.sprSuhu, android.R.layout.simple_spinner_item);
spinner.setAdapter(adapter);

// Set the ClickListener for Spinner
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView adapterView, View view, int i, long l) {
// TODO Auto-generated method stub
Toast.makeText(MainActivity.this,"Anda memilih satuan "
+ sprSuhu[i]+" ",Toast.LENGTH_SHORT).show();
text=sprSuhu[i];
pilihan=i;
hitung();
}
// If no option selected
public void onNothingSelected(AdapterView arg0) {
// TODO Auto-generated method stub
}
});
}

//Create an anonymous implementation of OnClickListener
private OnClickListener startListener = new OnClickListener() {
public void onClick(View v) {
//Log.d(logtag,"onClick() called - start button");
Toast.makeText(MainActivity.this, "The Start button was clicked.", Toast.LENGTH_LONG).show();
TextView tulisan = (TextView)findViewById(R.id.tulisan);
hitung();
//Log.d(logtag,"onClick() ended - start button");
}
};

// Create an anonymous implementation of OnClickListener
private OnClickListener stopListener = new OnClickListener() {
public void onClick(View v) {
//Log.d(logtag,"onClick() called - stop button");
Toast.makeText(MainActivity.this, "The Stop button was clicked.", Toast.LENGTH_LONG).show();
TextView tulisan = (TextView)findViewById(R.id.tulisan);
tulisan.setText("tadaa...");
//Log.d(logtag,"onClick() ended - stop button");
}
};
public void hitung(){
double hasil,suhu;
EditText editText1 =(EditText)findViewById(R.id.editText1);
TextView tulisan = (TextView)findViewById(R.id.tulisan);
tulisan.setText("hehehe, akhirnya...");
try {
hasil=Double.parseDouble(editText1.getText().toString());
tulisan.append(" \r\n(angka di bawah ini adalah "+Double.toString(hasil)+" )");
//hasil=Math.pow(hasil, 2);
tulisan.append(" \r\n[pangkatnya adalah "+Double.toString(Math.pow(hasil, 2))+" ] \r\nspinner bernilai "+text);
if (pilihan==0){
suhu=9./5.*hasil+32;
tulisan.append("\r\n Suhu "+Double.toString(hasil)+" C jika dikonversi akan menjadi bernilai:");
tulisan.append("\r\n"+Double.toString(suhu)+" F");
suhu=4./5.*hasil;
tulisan.append("\r\n"+Double.toString(suhu)+" R");
suhu=hasil+273;
tulisan.append("\r\n"+Double.toString(suhu)+" K");
}
if (pilihan==1){
suhu=5./9.*(hasil-32);
tulisan.append("\r\n Suhu "+Double.toString(hasil)+" F jika dikonversi akan menjadi bernilai:");
tulisan.append("\r\n"+Double.toString(suhu)+" C");
suhu=4./9.*(hasil-32);
tulisan.append("\r\n"+Double.toString(suhu)+" R");
suhu=(hasil-32)*5./9.+273;
tulisan.append("\r\n"+Double.toString(suhu)+" K");
}
if (pilihan==2){
suhu=9./4.*hasil+32;
tulisan.append("\r\n Suhu "+Double.toString(hasil)+" R jika dikonversi akan menjadi bernilai:");
tulisan.append("\r\n"+Double.toString(suhu)+" F");
suhu=5./4.*hasil;
tulisan.append("\r\n"+Double.toString(suhu)+" C");
suhu=hasil*5./4.+273;
tulisan.append("\r\n"+Double.toString(suhu)+" K");
}
if (pilihan==3){
suhu=9./5.*(hasil-273)+32;
tulisan.append("\r\n Suhu "+Double.toString(hasil)+" K jika dikonversi akan menjadi bernilai:");
tulisan.append("\r\n"+Double.toString(suhu)+" F");
suhu=4./5.*(hasil-273);
tulisan.append("\r\n"+Double.toString(suhu)+" R");
suhu=hasil-273;
tulisan.append("\r\n"+Double.toString(suhu)+" C");
}
} catch (NumberFormatException e) {
tulisan.setText(e.getMessage()+", masukkan angka");
}
}

}







run it
 

it will build


 and prompt us whether we want to install the built app, of course...



 here the result



Tuesday, June 10, 2014

Another AIDE ScreenShot on My Lenovo A3000

Here it is,
The screenshot of my Thermometer android app, using textview, edit text,spinner and button

AIDE on My Lenovo A3000

Here some screenshot of my AIDE






Empat Saksi

Akhir-akhir ini ada beberapa kasus gugatan yang ditolak oleh pengadilan

Suami yang digugat istri dengan bukti foto pesta seks dari hap sang suami

Istri yang digugat suami dengan bukti rekaman CCTV di sebuah gedung

...dan gugatan tersebut ditolak

...alasannya tidak ada saksi kejadian tersebut

...agar gugatan diterima maka harus ada dua saksi laki-laki atau empat saksi perempuan yang menyaksikan kejadian (lihat betapa laki-laki dibedakan haknya dengan perempuan)


... dan itu sungguh aneh. Dan saya yakin akan ada lebih banyak perselingkuhan setelah berita ini karena mereka tahu bahwa jika mereka melakukan diam-diam (tentu saja) maka tak akan ada yang bilang bahwa mereka selingkuh, secara hukum, ckckck.

Keanehan berikutnya, bagaimana jika memang benar-benar ada saksi? Jika mereka murni saksi, bukan pelapor, bukankah mereka sama saja dengan menyetujui tindakan si tergugat? Dalam keadaan seperti itu, apakah mereka bersedia bersaksi? Sepertinya tidak.

Jika mereka bersedia bersaksi akan sangat membingungkan, bayangkan pertanyaan jaksa "jadi anda melihat kejadian itu? tidak melarang?" dan pertanyaan berikutnya "apa buktinya jika anda telah melihat kejadian itu?" foto? nah, tadi sudah ditolak kan? repot lagi deh... dan kesaksian tidak sah, :)

Dengan logika, sebenarnya klausul "dua saksi laki-laki atau empat perempuan" yang menyaksikan kejadian itu dapat saja sudah sangat memenuhi syarat. Dengan melihat foto atau video kejadian yang telah terbukti bukan rekayasa sebenarnya dapat disimpulkan bahwa perselingkuhan benar-benar terjadi, bagaimana seseorang bisa tidak melihat hal itu? bahkan membantah bahwa itu tak terjadi, atau kurang saksi, jika video/foto itu disaksikan seratus orang, bukankah mereka juga merupakan saksi

...dan yang lebih aneh lagi, si penggugat kadang malah ganti digugat secara pidana karena "mencemarkan nama baik", dan gugatan dapat diproses, waduh  












Monday, June 9, 2014

AIDE

New Android user

Just grab Lenovo A3000 last Saturday

It's a quadcore 

Used to programmed on Eclipse with ADT on my mac, ran it on emulator (didnt have the gagdet until yesterday)

Searching Playstore for development tool and... voila... AIDE os in the first list :)

It just like the Eclipse+ADT plus...it can run and install the app on the Android device itself. No need a computer, :)


Friday, June 6, 2014

PCV Valve and Throttle Position Sensor on My 323F Astina


Drove it with broken PCV and TPS socket unplugged for straight two years without major problem

At least, my luck is gradually wornout

The symptoms began the moment I change the broken PCV valve.

After replaced the old broken PCV valve and installed the new one, there's no change at idle.

Another story when I stepped on throttle pedal, the engine is getting hesitant and the rpm didn't rise smoothly and it had tendency to not rise at all.


Hmm, if broken PCV valve and unplugged TPS proved okay, whilst new PCV valve and unplugged TPS result in trouble, then combination of new PCV valve and plugged TPS maybe solving the problem.

The result is I have low idle rpm, so far so good, and I stomped the throttle pedal, the rpm is increasing smoothly, this getting better and better until rpm reach 3000 and suddenly drop to 1000, ...

I press and hold the throttle pedal, hoping it can reach beyond 3000, to no avail. It drop every time it reach 3000 point.

Here, almost without doubt that the TPS is the trouble maker. Almost, since the idle setting and other setting is done with the TPS unplugged, so maybe my engine have wrong setup since begining, still...

Checked TPS with OhmMeter, the result is fine, no problem.

Checked TPS socket (cable to ECU) using voltmeter, the signal is OK, so the TPS isn't the problem.

My TPS is the switch-type-TPS (from many online source including discussion in Mazda Astina Indonesia ), in opposite to potentiometer-type. So it has three switch position mode. (look at the first pic)

Let us name three connector cable in TPS with A, B and C. The first position is when idle, without step on the throttle pedal, A and B is connected. (second pic)

The second position is when we slightly open throttle; A, B and C is connected together. (third pic)

Finally while we are on full throttle, B and C is connected. (4th pic)

I don't really know, maybe because my "exotic" setup since beginning, my 323F couldn't get right rpm while TPS is plugged, so I manually checked by bypassing it function using jumper.

Bypassing A and B through jumper resulted in erratic rpm, it oscilating from 1000 to 3000, ....., ups..., the throttle cable is stuck, make it right...., ok, rpm at idle is 1000, step the throttle, and...., still drop at 3000, duh....

The same with A, B and C connected together.

Don't have a choice, bypassing B and C and... Idle is 1000, step the pedal, it raise smoothly to 3000 and 3500, 4000 and so on..., huray...

Stick with this setting until now, :)





323f (5) amp (1) android (12) apple (7) arduino (18) art (1) assembler (21) astina (4) ATTiny (23) blackberry (4) camera (3) canon (2) cerita (2) computer (106) crazyness (11) debian (1) delphi (39) diary (286) flash (8) fortran (6) freebsd (6) google apps script (8) guitar (2) HTML5 (10) IFTTT (7) Instagram (7) internet (12) iOS (5) iPad (6) iPhone (5) java (1) javascript (1) keynote (2) LaTeX (6) lazarus (1) linux (29) lion (15) mac (28) macbook air (8) macbook pro (3) macOS (1) Math (3) mathematica (1) maverick (6) mazda (4) microcontroler (35) mountain lion (2) music (37) netbook (1) nugnux (6) os x (36) php (1) Physicist (29) Picture (3) programming (189) Python (109) S2 (13) software (7) Soliloquy (125) Ubuntu (5) unix (4) Video (8) wayang (3) yosemite (3)