Archive

Posts Tagged ‘Android’

PrimoSpot – Find parking space EZ in metro cities

August 24th, 2009

We all know how hard it is to live in the city while having a car, traffics and all that. But the most frustrating task is to park your car. Enter PrimoSpot: find free on street parking and compare parking garage prices. Search thousands of metro city parking signs for regulations and time left at a parking spot.

You can use the website to plan your trip: finding possible street parking spots, nearby garage hours and fees. And if you ride a bike, find a bike rack there too! You can also download the iPhone app on your iPhone so you can check up parking information wherever you go.

Tonight, I’m here to announce the launch of PrimoSpot Android app, available on the Android Market now! Go check it out! “PrimoSpot Parking” is the app name! Search “Parking” or “PrimoSpot”, you will find it on top of the list! This is THE ONLY app on the market now to help you find parking space!

We have NYC and Boston currently supported, but will expand to other metro cities very soon. There’s also a universal online widget available soon that you can embed in any web pages.

Meanwhile, here are some screen shots of the app in action:

Some Features:
- Uses GPS to find parking information around your current location
- Search entered address to find parking information
- Compare garage prices
- Remember where you parked your car with some reminding notes

Go grab a copy if you live in NYC and Boston and let us know what you think ^_^

Happy Driving!

Android Shogun Android, Mobile, iPhone , , , , , ,

Is Palm’s webOS already a lost cause?

August 21st, 2009

We all know the Palm Pre launch was a big success! I myself picked up the Pre on day one, along w/ a 2-year Sprint contract (weeping…). Merely less than 3 months after its launch, Palm webOS seems to have lost its momentum. Here I will use my own personal experience to write some of my thoughts on webOS in general, and why there’s an uphill battle for Palm to take on going forward.

Underneath webOS lies the embedded linux, much like Android, Nokia Maemo, etc. It’s reliable and proven in the smartphone OS market. On a higher level, Mojo SDK makes up all the high level APIs and frameworks. It mainly uses JavaScript to bridge the low level events/callbacks and high level API, such as GPS coordinates information, accelerometer readings, camera controls, etc. This approach is somewhat like those JavaScript frameworks, such as PhoneGap, http://sourceforge.net/projects/quickconnect/, and Rhodes, where they try to use the common framework built in JavaScript, and uses JavaScript to call underlying low level APIs in the devices, such as Android, iPhone, BlackBerry, etc. This architecture is very cool, but also brings down the performance, comparing to native SDK APIs found in iPhone and Android. For example, the Pre accelerometer is only at 4Hz (4 sample readings per second), comparing to about 100Hz in iPhone. This might be enough for casual usage, but certainly not enough for some serious gaming controls.

By the way, Palm opened Game Developer Cafe to try to lure some game developer on webOS. But without Open GL ES support on the API level (Pre’s hardware is comparable to iPhone, and is capable of running Open GL ES), it’s hard to find serious game developers who want to develop for webOS. You might say you can use canvas in webkit and build game on top of that. Well, canvas performance is still not up to the task, and plus, the current webOS webkit’s implementation of the canvas is not complete. Many essential features are missing, such as reading pixel data.

Mojo and webOS are based on HTML5, CSS, and JavaScript. They are all web standards. That’s where the “web” in the webOS name comes from, right? However, I found this below sentiment troubling. It’s an email from Palm’s product manager:
- Have an appealing design and user interface aligned with Palm UI guidelines and optimized for webOS (i.e., not a “browser” app)

Not a browser app? Are you kidding me? Are you turning your back against your foundation? Apple can rightfully deploy such bind-your-UI-to-my-HIG ‘cuz it’s an Apple product. You Palm is NOT Apple, yet. This is not a way to distinguish yourself. What you should do is to attract as many web developers to your webOS platform as possible. Not creating yet another new system for them to learn. Honestly, there are plenty of guys who can create better UI widgets/elements than the built-in Mojo widgets/elements. Please, Palm, stay to your core value. webOS apps ARE browser apps.

I also heard Palm’s working on virtual on screen keyboard recently. It’s cool and all. But before you doing that, take a look at this article: Virtual Keyboards on iPhone and Android. Please remember, no matter what you do, a virtual keyboard on a 3.1″ screen is never going to match the virtual keyboard on a 3.5″ screen. You just can’t grow the physical screen size.

As to the Mojo framework, my biggest disappointment is the lack of built-in Map API. In order to use Map embedded in your own application, with your custom marker icons and all, you will need to include external AJAX Map APIs, such as Google Map API v2/v3. These APIs work well, but they are not optimized for mobile devices. A Map API is a must for modern mobile OS. Though Apple only recently in their iPhone SDK 3.0 have they included the much needed Map Kit framework. But it works beautifully!

My biggest concern for webOS, however, is its openness of app source codes. Anyone can download the public SDK, enable developer mode on their Pre by entering the classic magic Nintendo cheat code, hookup the Pre with the USB cable, and bang, you have root access on your Pre. There, you can find virtually everything, including source codes for ALL the apps pre-installed and downloaded. Back a few years ago, when most websites were still running on static HTML, I used teleport program to download every single link/page on a given site. It’s messy but it gets the job done. Nowadays, with all these dynamic page scripting and web 2.0 stuff, it’s virtually impossible to get the complete html/css/js codes from any website. With palm webOS, it’s just a click away. Download the app, and there you go, the WHOLE app source codes! In there, you might as well find API Keys used by developers, possibly login information if not coded carefully. I was shocked that Palm didn’t even bother to put in some handy JavaScript compressor and confiscator, such as JSLint and Stunnix JavaScript Obfuscator and Encoder.

This was my big concern before webOS/Pre launch. As a developer, unless my project is open source, I take very careful steps to protect my codes, codes that I write with sweat and blood. Now on webOS, anyone with minimal efforts, can see everything I code up there. This is very discomforting, and Palm MUST address this issue or many developers will unlikely to jump to the webOS bandwagon.

The launch of iPhone 3Gs back in July killed some of webOS/Pre’s momentum. Even though Apple added not many cool features comparing to iPhone 3G. But with a large existing user base and die-hard apple fans everywhere, iPhone 3Gs has been selling extremely well, even in Japan! Meanwhile, Android is on route to be on a bunch of handsets by end of this year. Samsung InstinctQ and HTC Hero on Sprint around October, Motorola Sholes on Verizon, HTC Click on AT&T, G2 myTouch and Motorola Morrison on T-mobile. If Palm cannot address the source code protection issues, if Palm does not launch their second webOS phone (EOS?) by October, we have plenty of reasons to believe the battle against Apple has long been lost. If webOS’s licensing model is not as open and/or flexible as Android so that other handset manufacturers can put it on their own handsets, webOS could very well become a niche mobile OS, a mobile OS we us geeks are fond of hacking and tweaking, but will never reach the status of mainstream modern mobile OS.

Please Palm, do whatever it takes to address these serious issues! I wish Palm webOS best luck, however, the time is not on their side…

Android Shogun Android, BlackBerry, Mobile, Palm webOS, iPhone , , , , , ,

JavaEye.com Android Client Version 1 released!

August 8th, 2009

JavaEye is a software developers’ community site based in China.

Established on September 2003, JavaEye started with topics only
concerning about Java and Hibernate. Since then it has expanded to topics related to all software development disciplines. JavaEye was selected as the best 10 technology websites in 2005. We also obtained a lot of useful information from this site frequently; Therefore, we decided to bring this site to android platform.

The app took us 3 developers and 20 days on our spare time to finish.

The current alpha version has chat, site message inbox, and bookmarks features.

We utilized JavaEye.com’s API to accomplish the above.

This application is available on the Android Market. You can search it from your android phone by keyword “JavaEye”.

For those who did not have an android phone, you can download this application from the following link:
http://www.ChinaAndroidDev.com/apks/JavaEyeClient_1.0.1.apk

We are working on the next release. We are aiming to add GPS location/Map, Voice mail , background checking and notification

Android Shogun Android, Mobile , ,

2 OMS phones spotted… 移动支持的两款OMS手机

May 17th, 2009

OMS – Open Mobile System, is based on Android, customized by China Mobile. There are a few rumored phones that would run OMS. Today, at the mmarket (mobile market for China Mobile), I found 2 OMS phones at
the registration page.

Dopod A6188, 320×480, internal GPS, 3.2MP camera. (Dopod is the brand which HTC sells phones in China).

Borqs JadeSpring. Borqs is the company which customized Android to be OMS :) Seems like a secret phone for now. In Chinese, it means 玉春… ? Sounds weird…

Truly interesting!

Android Shogun Android, Mobile , ,

How to detect shake motion in Android – part I

April 17th, 2009

Gesture/Motion-based detection is fast becoming an integral part of many mobile applications.

One neat usage of it is to shake to erease.  The first one I’ve encountered is SketchUp from the early days of jailbreak iPhone.  Then there are shake to delete done-items on your todo/shopping list, etc.

There are many approaches to detect shake motion, one is from ClingMarks.  Basically it calculates the total delta (changes) in all 3 axises: x, y and z between the current even time and the previous one, and divide by the time elapsed to find its psudo-velocity.  (I call it psudo because it’s not actually a velocity in any direction; it’s more like a mixed-up velocity from 3 axises).  If this velocity is greater than a pre-defined threshold, it’s been viewed as a shake motion.

From the code point of view, you need to implement the SensorListener:

public class ShakeActivity extends Activity implements SensorListener

You will need to acquire a SensorManager:

sensorMgr = (SensorManager) getSystemService(SENSOR_SERVICE);

And register this sensor with desired flags:

ensorMgr.registerListener(this,
SensorManager.SENSOR_ACCELEROMETER,
SensorManager.SENSOR_DELAY_GAME);

In your onSensorChange() method, you determine whether it’s a shake or not:

public void onSensorChanged(int sensor, float[] values) {
if (sensor == SensorManager.SENSOR_ACCELEROMETER) {
long curTime = System.currentTimeMillis();
// only allow one update every 100ms.
if ((curTime - lastUpdate) > 100) {
long diffTime = (curTime - lastUpdate);
lastUpdate = curTime;

x = values[SensorManager.DATA_X];
y = values[SensorManager.DATA_Y];
z = values[SensorManager.DATA_Z];

float speed = Math.abs(x+y+z – last_x – last_y – last_z) / diffTime * 10000;

if (speed > SHAKE_THRESHOLD) {
Log.d(“sensor”, “shake detected w/ speed: ” + speed);
Toast.makeText(this, “shake detected w/ speed: ” + speed, Toast.LENGTH_SHORT).show();
}
last_x = x;
last_y = y;
last_z = z;
}
}
}

The shake threshold is defined as:

private static final int SHAKE_THRESHOLD = 800;

This is pretty straightforward. So if your app just simply needs a shake motion detection, w/o needing to know on which direction it’s shaken, this code is good enough. However, there are situations where a non-shake motion would be detected as shake due to the fact that the formula is not actually the correct or should I say a precise formula for determining the shake motion. I call this a coarse-grain approach.

In my next post, I will show you a more fine-grain approach, something I learned from iPhone SDK programming :)

You can download this sample here

Happy Coding!

Android Shogun Android, Mobile, iPhone , , ,

How to implement Swipe action in Android

April 16th, 2009

To implement swipe action in Android, such as the one used in iPhone homescreen unlock, actually Android SDK provides native support for gestures. Swipe is actually called Fling ^_^

You will need to extend SimpleOnGestureListener to implement your own handling on swipe/fling action:

class MyGestureDetector extends SimpleOnGestureListener {
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
}

To determine if it’s a valid swipe, you will need to make sure the fling falls into an almost straight path, with at least certain length of touch duration, so it’s a continuous touch, and with certain velocity of course.

So let’s define some constants:

private static final int SWIPE_MIN_DISTANCE = 120;
private static final int SWIPE_MAX_OFF_PATH = 250;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;

The max off path is to make sure the fling still falls within a somewhat straight path.

If onFling() method, you can do this:

if(e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
viewFlipper.setInAnimation(slideLeftIn);
viewFlipper.setOutAnimation(slideLeftOut);
viewFlipper.showNext();
} else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
viewFlipper.setInAnimation(slideRightIn);
viewFlipper.setOutAnimation(slideRightOut);
viewFlipper.showPrevious();
}

The viewFlipper is used to show how fling/swipe make the view animation/transition from one to the other.

At last, you need to make sure in your activity, you catch the gesture event by overriding onTouch() method:

@Override
public boolean onTouchEvent(MotionEvent event) {
if (gestureDetector.onTouchEvent(event))
return true;
else
return false;
}

Here’s a screenshot of the view in transition:

Android Swipe View Flipper in Action

Android Swipe View Flipper in Action

The sample source is attached here.

Android Shogun Android, Mobile , , , ,

Porting Android to Beagle Board

April 15th, 2009

Recently I got a Beagle Board rev C2. It’s a pretty nice hardware piece:
Beagle Board Hareware Specs

embinux has done a pretty good job of porting android to beagle board, and made it open source, here’s the link for the guide to port android.

Using Ubuntu, first compile the kernel, it’s pretty easy. You will need to install git and git-core if you haven’t used git before.

Then clone the git for android, and then compile. The source for android comes down to about 2.7GB. So prepare for a length download. Also note, you need at least 1GB~1.5GB of RAM to actually compile android. The JVM during compilation will eat up a lot of the RAM. If you don’t have sufficient RAM, the compilation will stuck at a random point during the process and never finish. I’ve encountered this problem on 2 different machines and finally switched to a 4GB MacBook 467 to finished the compilation.

Then apply the patches stated in the above porting guide.
Make a bootable SD card following instruction here
Partition 1 is for the uImage and boot loader; partition 2 is for the actual android file system.

Boot up the beagle board w/o inserting the SD card, then at prompt (using minicom/kermit under ubuntu or Tera Term/Hyper Terminal under windows), type in:
mmcinit // init mmc
fatload mmc 0 0×80300000 uImage // load uImage into memory address of 0×80300000
set boot arguments:
setenv bootargs console=ttyS2,115200n8 root=/dev/nfs rw nfsroot=192.168.1.5:/data/target ip=192.168.1.1::255.255.255.0 nolock,rsize=1024,wsize=1024 rootdelay=2
video=omapfb:mode:1280×720@50 init=/init
bootm 0×80300000 // boot up the loaded uImage

If everything goes well, u should see Android booting up ^_^

Android Shogun Android , ,

Android: programmatically toggle wifi on/off

April 15th, 2009

To toggle wifi within your application, you will first need the following permissions:
android.permission.ACCESS_WIFI_STATE
android.permission.CHANGE_WIFI_STATE
android.permission.WAKE_LOCK

Then in your code, you need to get an WifiMananger:

wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);

To toggle wifi on/off:

if (wifiManager.isWifiEnabled()) {
wifiManager.setWifiEnabled(false);
} else {
wifiManager.setWifiEnabled(true);
}

That’s it ^_^! It’s really simple!
You can download the sample project here

Android Shogun Android, Mobile ,

Install Android Cupcake on Nokia N800

April 1st, 2009

NITdroid is a kernel and userspace port from scratch of the Android operating system (by Google and the Open Handset Alliance) to the NITs hardware. It is a software alternative to the Maemo platform that ships with the Internet Tablets.

This project is an ongoing effort to make Android usable/useful on NIT devices (N770, N800, N810, N810WE).

You can follow a pretty good installation shell script here to do everything:
http://www.internettablettalk.com/forums/showthread.php?t=25736

I encountered a few problems and finally got it working, here’s my comment on the above thread:

I’ve successfully flashed my N800 with NITdroid. I’m a newbie in the Linux world so I will offer a few of my findings and mistakes so that others might find useful:
*one problem with open source stuff is lack of documentation or I should say thorough documentation.

In the nitdroid_complete.sh:
“echo NOTE: This program should NOT be run as root.
echo It has specific parts that need to run as root.”
What does this mean? confusing huh? What I found out is that… I’m logged in as my own username, but the shell script uses sudo (so the user will be root after the sudo command). There’s this $USER variable that refers to the current user. So essentially I’m running part of the script on my username/Desktop while other stuff is running on root/Desktop, one way or another. An easy fix is to replace $USER with your current username in the .sh file. Save and run as: sudo ./nitdroid_complete.sh so everything will be in your own home / Desktop folders.

I have this N800 from the early days so the internal SDK card (the one besides the battery) has only 128MB of memory. I thought I should flash/install the OS into the external SD card since the internal one is less than 512MB. So that’s my mistake #2.
Make sure you use the internal SD w/ at least 512MB of RAM and remove the external SD. My internal SD shows as /dev/sdc1 and the external shows as /dev/sdd1 if plugged in.

First boot of android, showing a few force close exception due to MMS, Alarm, etc.
Then black screen. Took out battery and reboot, much better now. Wifi works like a charm. However, the soft keyboard crashes all the time. So install this one instead:
http://code.google.com/p/netgents/

Now I got some hacking to do on it, besides my G1… ^_^

Thanks NITdroid team!!!

Android Shogun Android, Mobile , , , , ,

NPR Podcasts showcased by Google!

February 28th, 2009

A month ago, I received an email from Google’s Marketing department:

Hello! I’m Linda Tong, with the Android team at Google, and I am contacting you regarding your application on Android Market. Your application, NPR Podcasts, is currently one of the top apps in its individual category, and we would like to showcase it on the Android Market website at http://www.android.com/market/free.html#app=nprpodcasts.

And today, it shows:

npr_showcase

There are still some bugs and improvements I need to make.  But I really don’t have time now.  Hmmm… need to squeeze some time…

android Android, Mobile , , ,