J2ME for downloading Ringtones, Wallpapers etc

Any inputs on how to make use of J2ME to download ringtones, wallpapers, games etc onto a mobile device + handle content management?
Thanks in advance,
Seetesh

import java.util.*;
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.io.file.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class FileMidlet extends MIDlet implements CommandListener
private String currDirName;
private Command view = new Command("View", Command.ITEM, 1);
private Command back = new Command("Back", Command.BACK, 2);
private Command exit = new Command("Exit", Command.EXIT, 3);
private final static String UP_DIRECTORY = "..";
private final static String MEGA_ROOT = "/";
private final static String SEP_STR = "/";
private final static char SEP = '/';
public FileMidlet()
currDirName = MEGA_ROOT;
public void startApp()
boolean isAPIAvailable = false;
if (System.getProperty("microedition.io.file.FileConnection.version") != null)
isAPIAvailable = true;
try
showCurrDir();
catch (SecurityException e) {}
catch (Exception e) {}
else
StringBuffer splashText = new StringBuffer(getAppProperty("MIDlet-Name")).append("\n").append(getAppProperty("MIDlet-Vendor")).append(isAPIAvailable?"":"\nFileConnection API not available");
Alert splashScreen = new Alert(null,splashText.toString(),null,AlertType.INFO);
splashScreen.setTimeout(3000);
Display.getDisplay(this).setCurrent(splashScreen);
public void pauseApp() {}
public void destroyApp(boolean cond)
notifyDestroyed();
public void commandAction(Command c, Displayable d)
if (c == view)
List curr = (List)d;
final String currFile = curr.getString(curr.getSelectedIndex());
new Thread(new Runnable()
public void run()
if (currFile.endsWith(SEP_STR) ||
currFile.equals(UP_DIRECTORY))
traverseDirectory(currFile);
} else
showFile(currFile);
}).start();
else if (c == back)
showCurrDir();
else if (c == exit)
destroyApp(false);
void showCurrDir()
Enumeration e;
FileConnection currDir = null;
List browser;
try
if (MEGA_ROOT.equals(currDirName))
e = FileSystemRegistry.listRoots();
browser = new List(currDirName, List.IMPLICIT);
else
currDir = (FileConnection)Connector.open(
"file://localhost/" + currDirName);
e = currDir.list();
browser = new List(currDirName, List.IMPLICIT);
browser.append(UP_DIRECTORY);
while (e.hasMoreElements())
String fileName = (String)e.nextElement();
if (fileName.charAt(fileName.length()-1) == SEP)
browser.append(fileName);
else
browser.append(fileName);
browser.setSelectCommand(view);
browser.addCommand(exit);
browser.setCommandListener(this);
if (currDir != null)
currDir.close();
Display.getDisplay(this).setCurrent(browser);
catch (IOException ioe)
void traverseDirectory(String fileName)
if (currDirName.equals(MEGA_ROOT))
if (fileName.equals(UP_DIRECTORY))
// can not go up from MEGA_ROOT
return;
currDirName = fileName;
else if (fileName.equals(UP_DIRECTORY))
// Go up one directory
// TODO use setFileConnection when implemented
int i = currDirName.lastIndexOf(SEP, currDirName.length()-2);
if (i != -1)
currDirName = currDirName.substring(0, i+1);
else
currDirName = MEGA_ROOT;
else
currDirName = currDirName + fileName;
showCurrDir();
void showFile(String fileName)
try
FileConnection fc = (FileConnection)
Connector.open("file://localhost/" + currDirName + fileName);
if (!fc.exists())
throw new IOException("File does not exists");
InputStream fis = fc.openInputStream();
byte[] b = new byte[1024];
int length = fis.read(b, 0, 1024);
fis.close();
fc.close();
TextBox tb = new TextBox("View File: " + fileName, null, 1024,
TextField.ANY | TextField.UNEDITABLE);
tb.addCommand(back);
tb.addCommand(exit);
tb.setCommandListener(this);
if (length > 0)
tb.setString(new String(b, 0, length));
Display.getDisplay(this).setCurrent(tb);
catch (Exception e) {}
}

Similar Messages

  • Download Ringtone option is gone

    Blackberry Curve 8300:
    There used to be an option for downloading ringtones by following the path: Media - ringtones - Menu - Download Ringtones.  That option is now gone.  Anyone know how to retrieve it?  I am specifically looking to download the Song ID program allowing you to hold your phone up to a speaker to get information such as artist and song title. 

    Hi and welcome to the forums!
    Try doing a battery pull to help remove such anomalies.  Remove the back cover and pull out the battery with the device ON.  Wait about one minute and replace the battery.  Allow the BB to completely restart and see if that doesn't return your missing option.
    This is also good idea to do when you install apps or your file free number gets low and your BB appears sluggish. Happens to me when I've been posting on the forums for a while!
    There's an app, Quickpull , that will simulate a battery pull, but you don't have to actually remove the battery.  Make sure you use the version for your BB's OS.  go to options-about 3rd line down will read v4.x.x.xxx to see your OS version.l
    Good to have you here. Keep coming back.
    IrwinII
    Please remember to "Accept as Solution" the post which solved your thread. If I or someone else have helped you, please tell us you "Like" what we had to say at the bottom right of the post.

  • Downloaded ringtone and alert tone from itunes, showed on my phone, an hour later they were wiped??  cannot find them now? help (restarted, synched etc etc) same problem

    downloaded ringtone and alert tone from itunes, showed on my phone, an hour later they were wiped??  cannot find them now? help (restarted, synched etc etc) same problem

    Hi jaswantfromlondon,
    I apologize, I'm a bit unclear on the exact context for when or how these tones disappeared. If your tones have disappeared and you are having issues restoring them, you may find the information and steps outlined in the following article helpful (it refers specifically to 8.1.1, but the steps may more generally apply to your situation):
    Restore missing tones on your iPhone, iPad, or iPod touch running iOS 8.1.1 - Apple Support
    Regards,
    - Brenden

  • I just bought my first Iphone the 5S and when I turn on my bluetooth the ringtone for my text, calendar, etc. comes through my Bluetooth instead of the phone. Is there a way to have the tones use the phone while bluetooth is on?

    I just bought my first Iphone the 5S and when I turn on my bluetooth the ringtone for my text, calendar, etc. comes through my Bluetooth instead of the phone. Is there a way to have the tones use the phone while bluetooth is on?

    I would also like this issue addressed.
    I am using a Plantronics Voyager Pro+ and when it is connected to my iPhone 4, email and text sounds are not audible through the phone. The phone just vibrates when a new text or email is received.
    I don't really care if it plays through the headset, but it should at least play through the phone. I tested the headset from a BlackBerry and the alerts play fine.
    Message was edited by: picardsm

  • HT201272 A few songs from my old purchase is not available for download. It shows as purchased but I can't download it. Please help me resolve this problem, what do I need to do to enable download for all my purchased songs/movies etc. - Avinash

    Hi,
    A few songs from my old purchase is not available for download. It shows as purchased but I can't download it. Please help me resolve this problem, what do I need to do to enable download for all my purchased songs/movies etc.
    - Avinash

    The purchases are probably hidden:
    http://support.apple.com/kb/ht4919

  • I bought a ringtone on my old iPhone 4S and now on my iPhone 5 I tried to download it for my ringtone and when I hit but it says I already purchased it and asks if I want to purchase it again. With anything else it just downloads free.

    I bought a ringtone on my old iPhone 4S and now on my iPhone 5 I tried to download it for my ringtone and when I hit buy it says I already purchased it and asks if I want to purchase it again. With anything else it just downloads free. It won't simply download. Any pointers to get my ringtone back?

    Your ringtone will only be where you put it.
    You get one download.
    If you have failed to transfer it from your iphone to your computer, then do so.  You can then sync it to your new iphone.

  • Our computer crashed that we mainly used iTunes on for upgrades, new purchases, etc.  We've downloaded iTunes onto my laptop but none of my apps are in the library.  We've made this laptop an authorized computer, but it's still not working.  Why is this?

    Our computer crashed that we mainly used iTunes on for upgrades, new purchases, etc.  We've downloaded iTunes onto my laptop but none of my apps are in the library.  We've made this laptop an authorized computer, but it's still not working.  Why is this?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • I have iPhone 4S and I can't download iPhoto, iMovie etc. For free. Why?

    I have iPhone 4S and I can't download iPhoto, iMovie etc. For free. Why? When iOS7 went out it should be free. Iike it was said at keynote. I can't even download it on other iP5

    It's free if you bought iPhone, iPad, iPod touch after 1st of Nov. Sept 2013
    GarageBand is free on the App Store for all iOS 7 compatible devices; additional GarageBand instruments and sounds are available with an in-app purchase. iPhoto, iMovie, Pages, Numbers, and Keynote are free on the App Store for qualifying iOS 7 compatible devices activated on or after September 1, 2013. See www.apple.com/ios/whats-new/ for iOS 7 compatible devices. Downloading apps requires an Apple ID.
    Message was edited by: ckuan

  • Can't use downloaded ringtone for iphone!

    I downloaded and paid for a ringtone off of itunes on my iphone but i can't seem to make it useable as a ringtone, it is only in my itunes library. How do i use it as a ringtone??

    I don't think you bought a ringtone. You bought a song/whatever that must be now made into a ringtone. Yes, I understand that it said ringtone.
    On the left hand side of itunes, under Library, do you have a ringtone category? Is that ringtone shown in that category?
    If it is not, then you have yet to create the ringtone.
    In itunes:
    Buy the song/ringtone/jingle/whatever with a bell icon = 99 cents
    Find the song in your library an click the bell - the editor will come up
    Edit the song, in your case, there is no editing needed
    Click Buy = another 99 cents
    The ringtone will appear in your ringtone category, under library
    Sync your iphone

  • My icloud account keeps telling me that my user name or password for icloud is incorrect but it works for downloading apps etc and joining this forum

    my icloud account keeps telling me that my user name or password for icloud is incorrect but it works for downloading apps etc and joining this forum

    Accessing the itunes store and joining this forum are different accounts than an icloud account, so it's not necessarily true that your ID for icloud is the same as for itunes.
    Did you set up an icloud account?
    To create a new icloud account, go to
    http://www.apple.com/icloud/setup/

  • Where to download ringtones for Pixi Plus!

    I have recently purchased the Pixi Plus and thus far cannot figure out how to download ringtones.  Anyone have a good suggestion for an app or website for ringtones?  Thanks!

    Hi,
    Try check this app on your Apps Catalog : free music ringtones
    http://developer.palm.com/appredirect/?packageid=com.jamesharris.musicringtones
    If it do not work then just use your computer to download the files cause the device right now can not download songs directly from the phone on its web browser.
    You can try go to www.airmp3.net or www.mp3raid.com. After you download your music just use the USB drive mode to transfer it to the phone.

  • Downloaded audiobook but only downloaded Part 1 of 2??!!!? How can I get Part2? Who do I contact re downloading problems? I see no email address for a support team etc th ks

    Downloaded an audiobook to my ipad but I have just realised it's only downloaded Part 1 of 2??!!!?
    How can I get Part2?
    Who do I contact re downloading problems? I see no email address for a support team etc.
    Thx in advance

    I feel your pain. I awoke this morning to check my text messages on my iPhone (I'm away working in Norway) only to notice a text my girlfriend sent over the night. The title bar over the message listed her Italian mobile number instead of her name. I thought that odd, only to realize that virtually all of my contacts have disappeared from the iCloud. Even more strange, there appears to be no order, rhyme nor reason, or any form of sense as to what has been deleted. If this (and a few other issues I have with post-Jobs Apple) is indicative of Apple's trajectory, they're not going to be around long. I'm beyond ******-off over this and I'll be thinking very hard about buying Apple products in the future.

  • HT1491 I paid for a ringtone but it won't download. Help?

    I paid for a ringtone and it tells me that it is purchased but it wont download and it tells me to select check for available downloads from the store menu. How to I get to that on my iphone?

    drewdude39 wrote:
    it tells me to select check for available downloads from the store menu. How to I get to that on my iphone?
    You do the checking in itunes on your computer by clicking on Store in the menu and then check for available downloads
    Read http://support.apple.com/kb/TS2988?viewlocale=en_US
    Message was edited by: Ocean20

  • Downloading ringtones for iPhone

    I emailed some ringtones to myself, hoping to download them onto iTunes on my 3GS.  Does anyone know how to do this?

    From a website I found out how to create them with music on your iTunes through your computer.
    1. Find your song you want and cut off your favorite 30 second in "Get Info"
    2. Right click again and click "create AAC version"
    3. Right click new clone of the song that just appeared and right click and click "open in finder"
    4. When using Windows 7 or Vista, you will have to find the options in the Libraries window that pops up and find where you can enable viewing file extensions
    5. Find the song you want the ringtone of and change the extension from .m4a to .m4r
    6. Right click and press "open in iTunes"
    7. Find your new ringtone in iTunes and snyc it onto your phone.
    **if this is too much for you, you can always download ringtones by selecting a ringtone on an iOS device and pressing the "Buy More Tones" button
    Thank you for choosing Apple.

  • I have iphone 3 and for some reason I have lost all my downloaded ringtones and music on my phone and when I sync with my computer it won't reload it? Any suggestions?

    I have an iphone 3 and I have lost all my downloaded ringtones and music but when I sync with itunes it will not load it back on my phone. Does anyone have any suggestions?

    When you sync with itunes on your computer make sure you have all the songs that you want to sync selected in the music tab in itunes when you connect your phone.  Also with your phone connected click on the tones tab and make sure all the ringtones you want are selected there then sync

Maybe you are looking for