Thursday, 30 September 2010
iPad Tethering a Possibility
Arduino Bots and Gadgets
Make: Arduino Bots And Gadgets
Want to build your own robots, turn your ideas into prototypes, control devices with a computer, or make your own cell phone applications? It�s a snap with this book and the Arduino single-board microcontroller. Embedded systems are everywhere -- inside washing machines, cars, vacuum cleaners, and air conditioners. With Arduino, building your own embedded gadgets is easy, even for beginners.
This book gets you started with six fun projects: a stalker guard, robot insect, interactive painting, wireless smart home controller, boxing timer, and a cell phone controlled soccer robot. You�ll get impressive results quickly and gain the know-how and experience you need to invent your own gadgets.
- Discover Arduino, the popular electronic prototyping platform
- Get a great introduction to robots and electronic projects
- Learn how to turn ideas into working physical prototypes
- Use Android phones as key components in your projects
- Get everyone involved with projects that even beginners can build
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.
Wednesday, 29 September 2010
TinyUmbrella - AppleTV support
Tuesday, 28 September 2010
No More Web Jobs?
Thankfully, Smashing allowed web designer Michael Aleo to post a rebuttal stating why there will be web design jobs for years to come.
So I would like to make a couple of points on the premise of the original article.
First, let me say, don't get caught up in labels. Back in the day, everyone wanted to hire a "webmaster". Well for the most part that job title has gone away, but there are still plenty of jobs. Designer is just one title and if that title goes away, the fundamental skills will always be in demand.
Second, in my opinion, Twitter and Facebook are just better versions of chat clients like AOL Instant Messenger (AIM). Sending updates on what you ate for lunch is the future of the Net? I think not. Am I gonna buy books on Twitter? Buy clothes on Facebook? Once again, I think not. They are niche apps and their total domination of all things Internet is far from certain.
Finally, what technology are all those iPhone apps based on? Mostly web/browser based technologies. Mobile devices will change the Web and the Net. But replace it? I don't think so.
Monday, 27 September 2010
OS X: Organize Your Desktop by Hiding Apps
The Mac way to do this is to hide the applications. This works similar to the way Windows 7 minimizes apps when you click on an app on the taskbar. Hiding an app makes it disappear from the desktop, but it remains running in the dock. You can hide your current application or hide all the other running applications. This can be done from the menu, the keyboard, or with the mouse.
Menu Method
From the currently running application, click on the application name (e.g., if Chrome has the focus, "Chrome" will appear in the application menu). Half way down the menu, the following options are available.
- Hide AppNameHere
- Hide Others
- Show All
The options are pretty self explanatory.
Keyboard Method
Command-H - Hides the current app
Option-Command-H - Hide the other applications
Mouse Method
Option-Click Dock Icon - Hides the app selected by the click on the Dock.
Option-Command-Click Dock Icon - Hides the Other Apps and not the app just clicked on.
Note: Command = AppleKey on a Mac keyboard. (This is not the Control key.)
Sunday, 26 September 2010
Apple Earbuds Cheat Sheet
So here it is, the unofficial Apple Earbuds cheat sheet. If you want to save the page for offline use, click the link at the bottom of the page and bookmark that. Enjoy.
Unofficial Apple Earbud Cheat Sheet
Saturday, 25 September 2010
Android SDK Tools Revision 7 is available
You can refer to my article to know how to Install Android SDK on Eclipse 3.5 Galileo, in Ubuntu 9.10. Or, if you have install Android 1.6 SDK or later version, you can refer to another article to upgrade Android SDK using Android SDK and AVD Manager.
- Dependencies:
-
If you are developing in Eclipse with ADT, note that SDK Tools r7 is designed for use with ADT 0.9.8 and later. After installing SDK Tools r7, we highly recommend updating your ADT Plugin to 0.9.8.
- General notes:
-
- Added support for library projects that depend on other library projects.
- Adds support for aidl files in library projects.
- Adds support for extension targets in Ant build to perform tasks between the normal tasks:
-pre-build
,-pre-compile
, and-post-compile
. - Adds support for "headless" SDK update. See
android -h update sdk
for more information. - Fixes location control in DDMS to work in any locale not using '.' as a decimal point.
- To determine what revision of the SDK Tools you are using, refer to the "Installed Packages" listing in the Android SDK and AVD Manager.
Thursday, 23 September 2010
android-ui-utils: Android UI Utilities
android-ui-utils is a set of utilities that help in the design and development of Android application user interfaces. This library currently consists of three individual tools for designers and developers:
1. UI Prototyping Stencils
2. Android Asset Studio
3. Android Icon Templates
WARNING: These utilities are currently in beta.
Project Home: http://code.google.com/p/android-ui-utils/
Android UI Utilities Beta Demo
A screencast demo of the the new Android UI Utilities project. This demo highlights the stencil kit for Pencil and the Android Asset Studio, both available at http://code.google.com/p/android-ui-u...
Wednesday, 22 September 2010
The Future of JavaFX and Swing
Tuesday, 21 September 2010
JDK 7, JDK 8 and the Future of Java
Sunday, 19 September 2010
6 Great News Sites for Your iPhone or Mobile Phone
Here is the list:
On an iPhone, you can add a website to your desktop so it looks just like an app. To do this, navigate to the website in Safari. Then select the plus (+) and then "Add to Home Screen". This adds a an icon for the website on the currently selected page.
Friday, 17 September 2010
Vacation is almost over...
I've been on vacation for a little over a week. Don't worry I have not forgotten you :) When I return (Tuesday) I plan on continuing the planned changes for TinyUmbrella. In the meantime, stay away from 4.1 and all 4.2 betas if you value your unlock! Although the baseband preservation should work just fine for both of those versions, I would not recommend updating to those simply because a public jailbreak does not exist.
Wednesday, 15 September 2010
iPad Validating eBook Readers
Tuesday, 14 September 2010
The Death of RSS and Web Greatly Exaggerated
Yes, iPhone applications, Twitter and Facebook are on the rise. The last two sites are firmly based on Web technology and both offer RSS feeds to tracking account information. Frankly, an RSS feed for a few select Twitter accounts provides a much better way to read the site than trying to watch the fire hose that is your twitter feed. And most of those mobile phone applications are simply custom web applications, nothing more.
Now if you are talking about using your browser on a desktop computer to surf, I think that is on the way down. More and more surfing, buying, you name it on the web, is gonna be done on laptops, netbooks, tablets, and phones. All these smaller devices are gonna have browsers and browsing capabilities much more powerful than desktops have today.
The Web and RSS are not gonna die. But the way we use these technologies is changing fast.
A Real Linux/Unix Terminal for Windows with Cygwin
The default Cygwin installation uses the same command window as the Windows command prompt. Which is a little clunky, to say the least. Specifically, cutting and pasting text is a pain in the rear. You have to jump back and forth to the menu to cut and paste text. It is slow, clunky, and annoying.
The solution. Install rxvt with Cygwin. This is a terminal emulator that gives you all those cool cut and paste shell features on Windows. Just install rxvt from the shell options as part of your Cygwin install. Then, create a batch file like this in your Cygwin directory.
@echo off
C:
chdir \cygwin\bin
start rxvt -sr -sl 10000 -fg white -bg black -fn Consolas-20 -fb Consolas-20 -fm Consolas-20 -tn cygwin -e /bin/bash --login -i
I called my file,
term.bat
. Run the bat file and you get a bash shell and window that behaves just like it would on Linux or a Mac. Yays!Credit to c2.com for a pointer that got me started on this.
Monday, 13 September 2010
javax.naming.NamingException: Lookup failed for 'jdbc/dbname' in SerialContext
SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/dbname' in SerialContext [Root exception is javax.naming.NameNotFoundException: dbname not found]
What does this mean? Basically, you have not defined the JDBC resource in the Web Application. In my case, neither the Database Connection Pool nor the JDBC resource had been defined. Once the persistence resources are defined, the application should deploy without any errors.
When first analyzing the problem, I thought, incorrectly, that since the persistence resources were defined in an included library, no definition was required in the Web application. This is not the case.
Update
A reader made a fair point that no pointers on how to create the JDBC resource or Connection Pool are included in this post. Here are the steps assuming you already have a Java EE project created. Right click your project and select the following menu options.
- Connection Pool New -> Other -> Glassfish -> JDBC Connection Pool
- JDBC Resource New -> Other -> Glassfish -> JDBC Resource
Sunday, 12 September 2010
Tablet Support Android a Ways Off
I'm kind of surprised that Google is this far behind. Expect Apple to up the ante with an iPad 2 in the spring.
Thursday, 9 September 2010
How to set battery status of Android Emulator using the Emulator Console
To connect to the console of any running emulator instance at any time, use this command:
telnet localhost <console-port>
Where <console-port> is the number shown on your emulator.
Details of the usage, refer to the section Using the Emulator Console of the document Android Emulator.
Wednesday, 8 September 2010
TinyUmbrella with 4.1 Support
I put my money where my mouth is. I tested my code on my own iPhone 4 and was able to update to 4.1 without touching my baseband.
The only doctoring I did was removing my private info. The newest version of TinyUmbrella will have an added side-benefit of allowing you to update to 4.1 without the fear of baseband update. Of course, in order to downgrade back to 4.0.x you need to have your SHSH saved on Cydia or locally. Have fun :)
I've also seen a TON of questions about how to update from 4.0.x to 4.1 WITHOUT updating your baseband. I'll give you a quick rundown of how to do it.
- Get the latest TinyUmbrella (4.1.3)
- READ THE README TinyUmbrella README NOW Yes. You Read it.
- Run TinyUmbrella.
- Start TSS Server
- Open iTunes
- Restore 4.1 (NOT UPDATE) Yes this requires you to download 4.1 Here
- Let iTunes error with 1004 error (baseband update failed - we want this :) )
- Kick Device Out of Recovery
- \o/ -- You are now on 4.1 with 1.59.00 baseband!
I have heard a few folks voice concerns about how they can downgrade their 2.x baseband to 1.59.00 on iPhone4. Here are the basic steps:
- Close TinyUmbrella (if open)
- Close iTunes (if open)
- Remove ALL lines in your hosts file that contain gs.apple.com
- Windows: Start -> cmd -> ipconfig /flushdns
- Mac: Terminal -> dscacheutil -flushcache
- Start iTunes
- Restore (NOT UPDATE) Stock 4.0.2 iPhone 4 - 4.0.2 Download
Firefox Browser Gaming Competition
This a great idea. It will make a lot more developers aware of what is possible in a modern browser. Plus we should get some cool games out of it. :)
Detect Battery Info.
main.xml
<?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:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Battery Info."
/>
<TextView
android:id="@+id/batterylevel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Battery Level:"
/>
<TextView
android:id="@+id/batteryvoltage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Battery Voltage:"
/>
<TextView
android:id="@+id/batterytemperature"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Battery Temperature:"
/>
<TextView
android:id="@+id/batterytechology"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Technology:"
/>
<TextView
android:id="@+id/batterystatus"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Status:"
/>
<TextView
android:id="@+id/batteryhealth"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Health:"
/>
</LinearLayout>
AndroidBattery.java
package com.exercise.AndroidBattery;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
import android.os.Bundle;
import android.widget.TextView;
public class AndroidBattery extends Activity {
private TextView batteryLevel, batteryVoltage, batteryTemperature,
batteryTechnology, batteryStatus, batteryHealth;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
batteryLevel = (TextView)findViewById(R.id.batterylevel);
batteryVoltage = (TextView)findViewById(R.id.batteryvoltage);
batteryTemperature = (TextView)findViewById(R.id.batterytemperature);
batteryTechnology = (TextView)findViewById(R.id.batterytechology);
batteryStatus = (TextView)findViewById(R.id.batterystatus);
batteryHealth = (TextView)findViewById(R.id.batteryhealth);
this.registerReceiver(this.myBatteryReceiver,
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
}
private BroadcastReceiver myBatteryReceiver
= new BroadcastReceiver(){
@Override
public void onReceive(Context arg0, Intent arg1) {
// TODO Auto-generated method stub
if (arg1.getAction().equals(Intent.ACTION_BATTERY_CHANGED)){
batteryLevel.setText("Level: "
+ String.valueOf(arg1.getIntExtra("level", 0)) + "%");
batteryVoltage.setText("Voltage: "
+ String.valueOf((float)arg1.getIntExtra("voltage", 0)/1000) + "V");
batteryTemperature.setText("Temperature: "
+ String.valueOf((float)arg1.getIntExtra("temperature", 0)/10) + "c");
batteryTechnology.setText("Technology: " + arg1.getStringExtra("technology"));
int status = arg1.getIntExtra("status", BatteryManager.BATTERY_STATUS_UNKNOWN);
String strStatus;
if (status == BatteryManager.BATTERY_STATUS_CHARGING){
strStatus = "Charging";
} else if (status == BatteryManager.BATTERY_STATUS_DISCHARGING){
strStatus = "Dis-charging";
} else if (status == BatteryManager.BATTERY_STATUS_NOT_CHARGING){
strStatus = "Not charging";
} else if (status == BatteryManager.BATTERY_STATUS_FULL){
strStatus = "Full";
} else {
strStatus = "Unknown";
}
batteryStatus.setText("Status: " + strStatus);
int health = arg1.getIntExtra("health", BatteryManager.BATTERY_HEALTH_UNKNOWN);
String strHealth;
if (health == BatteryManager.BATTERY_HEALTH_GOOD){
strHealth = "Good";
} else if (health == BatteryManager.BATTERY_HEALTH_OVERHEAT){
strHealth = "Over Heat";
} else if (health == BatteryManager.BATTERY_HEALTH_DEAD){
strHealth = "Dead";
} else if (health == BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE){
strHealth = "Over Voltage";
} else if (health == BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE){
strHealth = "Unspecified Failure";
} else{
strHealth = "Unknown";
}
batteryHealth.setText("Health: " + strHealth);
}
}
};
}
Download the files.
Related Article:
- Home Screen Battery Widget
Tuesday, 7 September 2010
TinyUmbrella - New Updates with 4.1 looming...
Let me preface this by saying that it is important that you do not update to 4.1 if you wish to keep your unlock and jailbreak.
I've updated TinyUmbrella in anticipation of the imminent release of iOS 4.1. Here are some notable features. (Sorry I have not finished the changes I mentioned previously as these features I felt were VERY important with 4.1 coming)
- Baseband Protection - Updating to 4.1 using TinyUmbrella will protect your baseband from update. THIS ONLY APPLIES TO IPHONE 4!!!!! If you have a 3G or 3GS and you update to 4.1 your baseband will likely be updated.
- SHSH Retrieval from Cydia - If you don't have your SHSH locally, TinyUmbrella will request them from Cydia on-demand; allowing the restore to continue
- Automatically point hosts to Cydia - Once you close TinyUmbrella, it points your hosts file to Cydia (for further baseband protection and update/restores without TinyUmbrella)
EDIT: I've also added iPod Touch 4G 4.1 support :)
Detect Battery Level
A BroadcastReceiver, myBatteryReceiver, is implemented and registered to receive ACTION_BATTERY_CHANGED, and retrieve "level" via getIntExtra() method.
main.xml
<?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:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:id="@+id/batterylevel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Battery Level:"
/>
</LinearLayout>
AndroidBattery.java
package com.exercise.AndroidBattery;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.widget.TextView;
public class AndroidBattery extends Activity {
private TextView batteryLevel;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
batteryLevel = (TextView)findViewById(R.id.batterylevel);
this.registerReceiver(this.myBatteryReceiver,
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
}
private BroadcastReceiver myBatteryReceiver
= new BroadcastReceiver(){
@Override
public void onReceive(Context arg0, Intent arg1) {
// TODO Auto-generated method stub
int bLevel = arg1.getIntExtra("level", 0);
batteryLevel.setText("Battery Level: "
+ String.valueOf(bLevel) + " %");
}
};
}
Download the files.
Related Article: Detect Battery Info.
Monday, 6 September 2010
PHP: Call to a member function on a non-object
class MyClass{As soon as the
private $myObject;
public function MyClass(){
$myObject = new MyObject()
}
}
$myObject
variable is accessed the following error is thrown: Call to a member function on a non-object. What?????
This is PHP not Java nimrod. :)
$myObject
is not getting initialized because the syntax is incorrect. Try this:class MyClass{That should fix it right up. This sort of stuff always happens to me as I bounce between languages. lol.
private $myObject;
public function MyClass(){
$this->myObject = new MyObject()
}
}
Friday, 3 September 2010
iOS 4.1 and iTunes 10
- iOS 4.1 is not currently jailbroken - you WILL lose your jailbreak
- iOS 4.1 contains a new baseband - you WILL lose your carrier unlock as provided by ultrasn0w.
- If you ignore the warning and update to 4.1, you can downgrade to whatever version you have SHSH for (either locally or on-file at Cydia. So if TinyUmbrella shows SHSH for 4.0.1, you can downgrade to that version. That said - you cannot downgrade your baseband /ever/. Once you update to a firmware with a new baseband, you are stuck on that baseband regardless of firmware downgrade.
Thursday, 2 September 2010
Copy and Paste using ClipboardManager
You do not instantiate this class directly; instead, retrieve it through getSystemService(String).
main.xml
<?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:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<EditText
android:id="@+id/src"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/dest"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/copynpaste"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Copy'n Paste"
/>
</LinearLayout>
AndroidCopynPaste.java
package com.exercise.AndroidCopynPaste;
import android.app.Activity;
import android.os.Bundle;
import android.text.ClipboardManager;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class AndroidCopynPaste extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final EditText src = (EditText)findViewById(R.id.src);
final TextView dest = (TextView)findViewById(R.id.dest);
Button copynPaste = (Button)findViewById(R.id.copynpaste);
final ClipboardManager clipBoard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
copynPaste.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
clipBoard.setText(src.getText());
dest.setText(clipBoard.getText());
}});
}
}
Download the files.