Latest Entries »

Showing posts with label iPhone. Show all posts
Showing posts with label iPhone. Show all posts

Wednesday, August 19, 2009

How To Install & Run Java On iPhone


iPhone is a great phone to develop applications for. Unfortunately Apple decided to restrict developing iPhone applications in a less known language called Objective C, which is used pretty much within Apple (and by Apple developers) and almost nowhere else. Only Steve Jobs knows the reason behind this strange decision. Java (J2ME) is the most popular language & platform for mobile development. So Java developers need a way to develop applications for iPhone too by leveraging their core competency.


Apple's SDK for the iPhone, as you know, is based on Objective-C as the development language as well as Cocoa for the GUI.

Unfortunately Apple's super-restrictive license agreement for the iPhone SDK prohibits the porting of the Java virtual machine to the iPhone. Today we will talk about how we can use Open Source Java to run applications which will run on Apple's iPhone. The open source project by Arno Puder, Associate Professor at the San Francisco State University, uses a cross-compiler to convert Open Source Java code to Objective-C and provide a Java-based implementation of the Cocoa library. With the help of these tools, iPhone applications can be written in pure Java.

Using the Java version of Cocoa, it is possible to run a Java-based iPhone application as a Java desktop/applet application that can be cross-compiled to run natively on the iPhone.






AlcheMo-for-iPhone - Automated J2ME to iPhone porting solution
alcheMo for iPhone contains translator to convert J2ME application source code to equivalent C++ source code for iPhone.

No manual adjustments to the translated source code are required. Compiled using the standard Xcode toolchain and linked with alcheMo's optimized run-time library, a native iPhone application is produced.

alcheMo for iPhone is capable of converting J2ME applications utilizing an extensive subset of Java ME CLDC 1.1 and MIDP 2.0 (including touch screen support) and supports several JSR extension APIs including the JSR-256 mobile sensor API. This automatic translation process is instantaneous, repeatable and doesn't require iPhone specific experience.

Garbage collection and automatic memory management is one of the strengths of the J2ME environment. Unlike on Macintosh OS X, Objective C on iPhone does not support garbage collection. By incorporating an advanced garbage collector, alcheMo eliminates the need for manual memory management. Whole classes of common programming errors such as dangling pointers are thus prevented.

The initial version of alcheMo for iPhone is optimized for mobile games.

The bad news is that their beta program has closed on April 24th, while they are preparing for commercial release. alcheMo for iPhone has backing from Sun Microsystems.

BTW: During Java One 2008, Sun officials repeatedly mentioned that they successfully ran Java on iPhone but are thwarted only by Apple's licensing restrictions in publicly announcing it. alcheMo circumvents Apple's licensing restrictions with their language translator.

Using Java on Unlocked & Jailbraked iPhone with Installer

Note: The legality of the procedure below is dubious. IANAL.










First you need to unlock and jailbrake you iPhone. You can use the windows user interface for ZiPhone to jailbreak, unlock and activate any verion of iPhone.

Then you need to have the installer app on iPhone. Installer.app is a UIKit based package manager for the iPhone. It works by downloading packages over WiFi (wireless networking) or EDGE. It supports installing, updating and uninstalling applications from multiple sources.

winpwn can simplify the above steps for you.

Now go to Installer and install Mobile Terminal and Cydia Installer. Restart iPhone.

Run Cydia Installer and go to Java section and select iPhone/Java which will install the virtual machine, libraries etc. Then install Jikes (java compiler). Now restart iPhone again.

That's it, you are done.

How to load, compile & run Java applications on iPhone
First install Java on iPhone following instructions in the section above before reading this.

You can upload Java files to iPhone using iPhone Browser.





You can run the class file as usual:
java MyFirstJavaProgramForIPhone

Java on iPhone - Concluding thoughts
The second method (using jailbraked iPhone) suffers from three major problems.
1. To use your Java applications, your user will also have to jailbrake their iPhone. As such its usage will be limited to highly technical people who are not afraid of tinkering with their costly iPhone and potentially even risk damaging it permanently!

2. While it may be fine for experimenting, the legality is dubious. You may run into problem with Apple for selling or even distributing such applications.

3. The jailbraked versions of iPhone may not be compatible with future firmware updates, and Apple will try their best to disable them at every opportunity and had done so in the past.

All of the above makes method 2 unsuitable for commercial use.

Commercial J2ME developers have to wait for commercial release of alcheMo-for-iPhone. Innaworks is well known for porting standards compliant J2ME to BREW mobile platform. I expect their solution to be ready in 2-3 months time. If you do not have the time then download Apple's iPhone SDK and start coding in Objective C.
BTW: Make sure you read the iPhone SDK agreement carefully before you invest huge sums in iPhone development.








Run Terminal (installed above) and use java (jikes) compiler to compiler your program. For example:
jikes -cp /usr/lib/rt.jar MyFirstJavaProgramForIPhone.java

Wednesday, March 11, 2009

Add new custom themes to your iPhone

Here are some instructions on how to get themes onto your iPhone.If a theme is not available through the installer, you will have to add it manually yourself. First, you will need to use the installer.app and install OpenSSH on your iPhone. You will then need to install WinSCP on your computer. To connect to WinSCP you will need to go into your settings on your iPhone into Wi-fi, click on the little arrow next to the Wi-Fi you are connected to and get the ip address. Now open WinSCP on your computer….the Host Name is your ip address (with the periods) the user name is root and the password is alpine. Don't worry about the Private key file, you don't need to put anything there. Hit login.








Once WinSCP opens, the themes go into the var/root/library/SummerBoard/Themes folder. Once you are in that folder you will see all the themes that are on your iPhone. This is where you will want to add your new themes.

Create a folder somewhere on your computer that is the title of the theme you would like to add (ex…Chalkwork) then inside of the Chalkwork folder create another folder called Icons (with a capital "I"). Inside the Icons folder put all of the icon images that you would like to have. They must be named the same as the Title of the app, starting with a capital (Ex…Calendar, Customize, SummerBoard, Photos, Stocks….). You can also add a Dock and Wallpaper to the Chalkwork folder, they also need to be capitalized (do not put them in the Icons folder…just in the main Chalkwork folder). Once you have a folder of the theme with a folder of icons inside it you just drag the whole folder, Chalkwork, into Themes on WinSCP and hit Copy. Once it is done transferring you can go on your iPhone into SummerBoard and select the theme you just added. Note: your iPhone has to be on for the file to transfer!

If you are downloading a theme that is in a zip file…you will have to open the zip file and then create a folder on your computer that is the same name as the theme you are trying to download. Then copy the Icons folder from the zip file into the folder you created on your computer. This unzips the file so that you can add it to SummerBoard through WinSCP. You can also copy the wallpaper and dock out of the zip file into the file you created if you would like them too.

Tuesday, February 10, 2009

Create custom ringtones for your iPhone

Hi Folks,

There are 3 ways to get ringtones on your iPhone.
1. Buy ringtones from iTunes store.
2. Create custom ringtones throurh iTunes.
3. Create custom ringtones through Audiko.

This article is for those who loves to have free custom ringtones on their iPhone,









2. Create custom ringtones throurh iTunes.

Go to iTunes
Select the song you want to convert as ringtone.
Right click on the song name and select “Get Info”
















Proceed to the “Options” tab and check the boxes for “Start Time” and “Stop Time”
















Figure out which section of the song you’d like to use as the ringtone. Then enter the appropriate starting and ending time for it. Click OK when done

NOTE: An iPhone ringtone can be up to 40 seconds in length.

Once you are back on the iTunes Library screen, right click on the song again and select “Convert Selection to AAC.” This will re-encode the selected portion of the song.















NOTE: If you can’t find the “Convert Selection to AAC” menu, go to your PREFERENCS — ADVANCED — IMPORTING and select “AAC Encoder” under the “Import Using” drop down menu.









Once conversion is complete, you should see a 2nd instance of the song much shorter in length









To avoid clutter, it is recommended that you delete the newly converted song from your iTunes Library. To do this, simply right click on the new song, select “Delete”, confirm removal but be sure to “Keep File” instead of moving it to the recycle bin.








The last thing that we need to do now is to locate your newly created song in your iTunes Music folder and rename the file extension to a ringtone format.









Important Note :
Format is m4r
Ex: If file name is mysong.mp3 then rename it to mysong.m4r

3. Create custom ringtones through Audiko.

It is very easy to create your custom ringtones, goto
Create Ringtones

On the home page click on "upload your favourite song", Choose your favorite song from your system.

Note: This application creates a ring tone of maximum 40 seconds duration.

You can choose the range from the faded part on the screen.

Customize the ringtone duration (1-40 sec) and also you can choose the particular part of your uploaded song.

Your rintone is ready, click on "download ringtone for iPhone".

You can also search for your favourite artist albums.

Note: Play this file through iTunes, on top left under the Library click on the Ringtones you will find your rintone. Finally syncronize your iPhone with iTunes library.

After syncronization disconnect your iPhone, navigate to
Settings-->>Sounds-->>Ringtone-->>Select your ringtone.

I hope this information might help you to get some free entertainment stuff.