java-me

HTTP authentication in J2ME

邮差的信 提交于 2019-12-29 06:56:34
问题 I'm trying to create a J2ME app, which talks to webserver using HttpConnection connector. When I am talking to the WebServer, I have to authenticate using Basic HTTP auth, which normally goes like http://username:password@website.com/rest/api/method But in J2ME, when I construct a url of this form, it doesn't work. I also tried adding request property, hc = (HttpConnection) Connector.open(url); hc.setRequestProperty("User", "alagu"); hc.setRequestProperty("pass", "mypassword"); but didn't

Privileged operations in netbeans mobility

允我心安 提交于 2019-12-29 06:30:53
问题 I'm writing a Java ME app that will use privileged operations such as messaging. By default the user is prompted to confirm each of these operations, but I would like to run it as a background service. Documentation says to request permission in the jad file, I have done so and presume it will work on a device. However I would like to test this on the Netbeans mobility emulator first. I tried signing the app as "trusted" but my emulated execution still prompts the user for permission. 回答1:

save data from servlet to recordstore in j2me

不想你离开。 提交于 2019-12-25 19:35:01
问题 I am developing an j2me application which is communicating with the database using servlet. I want to store the data received from servlet into record store and display it.how this can be achieved?Please provide code examples. Thank you in advance public void viewcon() { StringBuffer sb = new StringBuffer(); try { HttpConnection c = (HttpConnection) Connector.open(url); c.setRequestProperty("User-Agent","Profile/MIDP-1.0, Configuration/CLDC-1.0"); c.setRequestProperty("Content-Language","en

The best alternative of Math.pow in J2ME

天大地大妈咪最大 提交于 2019-12-25 18:03:41
问题 What is the best alternative of the Math.pow() method in J2ME as I could come to the conclusion that J2ME does not support the Math.pow() method and some other methods such as Math.exp() and alike. I'm asking this question only to find one of the best available solutions. 回答1: Try com.steema.teechart.misc.MathUtils Here's the page I got this info on http://www.steema.com/files/public/teechart/java/v1/docs/JavaDoc/com/steema/teechart/misc/MathUtils.html Looks like you'll have to go the third

Expecting End of File Exception in parsing xml data for Blackberry application

点点圈 提交于 2019-12-25 17:17:47
问题 I am getting parser exception as "Expecting End of File" while parsing xml data for Blackberry application? How do I fix it? 回答1: I encountered the the same org.xml.sax.SAXException while developing a child class of org.xml.sax.helpers.DefaultHandler for processing an XML file on Blackberry. The issue in my case was that my sample XML file was not well-formed. Specifically, there was not only one root element in the XML file. My broken XML file had several root-level tags, and SAX was

Fetch data from server to my application in j2me

感情迁移 提交于 2019-12-25 14:38:09
问题 I want to fetch data from server side to my application which is in j2me. The data to fetch from server is like sms, mms etc which are already stored in server. Do I need to use XML parsing for this. If yes the how can I use it? Please send me the code for it. If no then what should I use and help me through code. 回答1: You can use webservice to communicate between your server and your mobile client. The design would be like Also See Introduction to J2ME Web Services Understanding the Web

Try to connect to server with XMPP Connection

老子叫甜甜 提交于 2019-12-25 12:44:13
问题 I am trying to connect from a blackberry device to an XMPP server. I searched over the web and found the smack.jar file that has the XMPP classes ready for use. So I created a new project and added the smack.jar file to the imported jar files. Then in the project I added the following: public void login(String userName, String password) throws XMPPException { ConnectionConfiguration config = new ConnectionConfiguration(IP, PORT, "gmail.com"); connection = new XMPPConnection(config);

MIDP 2.0 push registry

喜夏-厌秋 提交于 2019-12-25 12:12:36
问题 We would like to use MIDP2.0 push registry to invoke our MIDLet at regular interval to check for new messages from server. If another MIDLet is already running in the foreground will our MIDLet be able to be invoked simultaneously? Will the behavior vary from device to device (e.g. Nokia S-60, Motorola, Samsung, LG)? 回答1: Behavior will definitely vary. Some devices can't handle multitasking (e.g. Nokia's Series 40 devices) and i highly doubt that your application will be invoked by

MIDP 2.0 push registry

↘锁芯ラ 提交于 2019-12-25 12:12:01
问题 We would like to use MIDP2.0 push registry to invoke our MIDLet at regular interval to check for new messages from server. If another MIDLet is already running in the foreground will our MIDLet be able to be invoked simultaneously? Will the behavior vary from device to device (e.g. Nokia S-60, Motorola, Samsung, LG)? 回答1: Behavior will definitely vary. Some devices can't handle multitasking (e.g. Nokia's Series 40 devices) and i highly doubt that your application will be invoked by

Blackberry radio app streaming audio

痴心易碎 提交于 2019-12-25 08:51:28
问题 I am building a radio app in BB 5. I have a .pls url where I find my urls to play the stream. My issue is. I need to build a Buffer to play this stream because the file which is downloaded is too big to play it inmediatly, but I don't know how to build this buffer. Any idea? I think that it must be something similar to that Streaming media BB But I want something more simple, only play and stop the radio streaming. 回答1: Ok I've solved this, using the package of streaming from the code