Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Tuesday, September 20, 2011

Tinkering with Android: Hello, Android! Ü

Oh yes! Finally, I said hello to Android. Haha. :)
In my last post, I thought I was doing something wrong that's why I don't see the Hello, Android app working.

Thank you so much to this post from anddev.org, I finally realized that I just have to play around with the emulator much like anyone would do with the real Android phone. Hahahaha. I'm such an ignoramus. >.<


So here's what I did:
Wait for this loading screen to finish.
Tried clicking around this screen until I happened to...

Sunday, September 18, 2011

Tinkering with Android: Help Wanted

I am attempting to study programming in android.
But as early as the Hello World app, I am already stumped. >.<


After following the installation instructions for the Android SDK (I installed Android 3.2 API Level 13), and ADT Plugin for Eclipse (my version's Helios), I then proceeded to the HelloWorld app tutorial.


The first time I run it, I got this from Eclipse console:


[2011-09-17 13:28:46 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
[2011-09-17 13:28:46 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2011-09-17 13:28:46 - Emulator] please use -help for more information


Apparently, the android sdk has a bug for paths which includes spaces. >.< My sdk is installed in "F:\Program Files\Android\android-sdk\". So I manually changed the path from Eclipse in Window->Preferences->Android to "F:\PROGRA~1\Android\android-sdk\".


However, there is another problem:
[2011-09-17 13:58:23 - HelloAndroid] Automatic Target Mode: Preferred AVD 'my_avd' is not available. Launching new emulator.
[2011-09-17 13:58:23 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'
[2011-09-17 13:58:55 - HelloAndroid] New emulator found: emulator-5554
[2011-09-17 13:58:55 - HelloAndroid] Waiting for HOME ('android.process.acore') to be launched...
[2011-09-17 14:00:14 - HelloAndroid] emulator-5554 disconnected! Cancelling 'com.example.helloandroid.HelloAndroid activity launch'!


So I tried uninstalling EVERYTHING and reinstalling EVERYTHING. T_T And this took almost like forever. T_T

Tuesday, November 3, 2009

YouAndMe.java

import emotions.*;
private class YouAndMe {
private String you;
private String me;
private int arguments;
private boolean isUsOkay;
private boolean youHappy;
private boolean meHappy;
private boolean youFeelLoved;
private boolean meFeelLoved;
private YouAndMe(String you, String me, boolean isUsOkay, int arguments) {
this.you = you;
this.me = me;
this.isUsOkay = isUsOkay;
this.arguments = arguments;
youHappy = false;
meHappy = false;
youFeelLoved = false;
meFeelLoved = true;
}
private String willToBeTogether(){
if(youHappy && youFeelLoved && isUsOkay && (arguments == 0)){
return “We will be together!”;
}else{
return “We will not be together”;
}
}
private static void main(String arguments[]){
YouAndMe us = new YouAndMe(”best”, “angel”, false, arguments.length);
System.out.println(us.willBeTogether());
}
}