java-me

OAuth Twitter and Blackberry

試著忘記壹切 提交于 2019-12-01 11:17:10
I have a j2me project on blackberry that needs to connect to twitter. I did most of the hard stuff already, I've got an api that guided me through to the access token pretty easily. Now I can't seem to get the authentication to work with a status update in REST. I know my tokens are valid because if I run a GET method like verify credentials, it's fine, everything is valid. But POST messages are just confusing me. Am I supposed to pass in a whole consumer key, signature, oauth version, etc every time I update a status? Or do I just pass the access token? Are they all supposed to be POST

How can I convert a cp1251 byte array to a utf8 String?

半城伤御伤魂 提交于 2019-12-01 10:54:03
We don't have the cp1251 code page available on a phone, so new String( data, "cp1251" ) doesn't work. We need a function with signature something like String ArrayCp1251toUTF8String(byte data[]); First, there's no such thing as a "UTF-8 string" in Java, they're just strings. But you don't need to worry about the string's encoding, just the encoding of the bytes you're converting. Since cp1251 (or windows-1251 ) is a single-byte encoding, decoding is a simple matter of using the byte value as an index into an appropriate array of char values. Here's an example: static String decodeCp1251(byte[

j2me - Out of memory exception, does it have anything to do with the maximum heap or jar size?

可紊 提交于 2019-12-01 10:35:00
问题 I'm currently developing an app for taking orders. Before I ask my question, let me give you a few details of the basic functionality of my app: The first thing the app does once the user is logged in, is to read data from a webservice (products, prices and customers) so that the user can work offline. Once the user have all the necessary data, they can starting taking orders. Finally, at the end of the day, the user sends all the orders to a server for its processing. Now that you know how

BlackBerry Data Usage

浪尽此生 提交于 2019-12-01 10:29:21
Using the RIM APIs. is there an accurate way of collecting the amount of data coming in and out of a service provider (Not including WiFi/Bluetooth data). Unfortunately I have tried RadioInfo.getNumberOfPacketsReceived() and RadioInfo.getNumberOfPacketsSent() and they also include Wi-Fi usage, at least when routing through BlackBerry Infrastructure. Fermin Have you tried using RadioInfo.getNumberOfPacketsSent() and RadioInfo.getNumberOfPacketsReceived() to monitor data usage? 来源: https://stackoverflow.com/questions/722146/blackberry-data-usage

Create Landscape Game Canvas for Asha 303

让人想犯罪 __ 提交于 2019-12-01 10:20:46
问题 i've searched all the forum bet never found any answer satisfy my question. I want to create a game with landscape orientation for Nokia Asha 303, are there any way to rotate the game canvas 90 degrees so the orientation become landscape orientation? Because i look at this video Angry Bird Asha 303. The game has landscape orientation so i curious how to do that in j2me. Thanks, 回答1: Since MIDP 2.0 we can use an Sprite to rotate an image in 90 degrees. First thing we need is an Image of the

Convert char to lower case in J2ME without using the Character class

非 Y 不嫁゛ 提交于 2019-12-01 09:53:30
问题 I'd like to convert a char to lower case in a J2ME app. The usual Character.toLowerCase() doesn't work for an arbitrary Unicode character in J2ME, so I need some light API, or, preferably, a piece of code that would do so. Thanks! 回答1: Based on the toLowerCase() method from Character in JavaSE JDK: char lowerChar = (char)CharacterData.of((int)upperChar).toLowerCase((int)upperChar); You can read the source code from the JDK and understand what is really done here and apply the same thing with

Can I use eclipse to write j2me code?

可紊 提交于 2019-12-01 09:40:39
please guys, before I download eclipse, is it possible to use it to compile j2me code, or it is used only for android applications? I am finding netbeans difficult to work with and I was wondering if eclipse was easier. I am new, I need help to start up writing j2me as well as using netbeans or eclipse, I am confused, I am trying to use netbeans, but I don't understand it. Is eclipse easier and j2me compatible? Check out the Mobile Tools for Java - it's the evolution of the EclipseME plugin. You can definitely do all your J2ME things with this package. Thirumoorthy first install WTK sun_java

BlackBerry Data Usage

喜欢而已 提交于 2019-12-01 09:26:10
问题 Using the RIM APIs. is there an accurate way of collecting the amount of data coming in and out of a service provider (Not including WiFi/Bluetooth data). 回答1: Unfortunately I have tried RadioInfo.getNumberOfPacketsReceived() and RadioInfo.getNumberOfPacketsSent() and they also include Wi-Fi usage, at least when routing through BlackBerry Infrastructure. 回答2: Have you tried using RadioInfo.getNumberOfPacketsSent() and RadioInfo.getNumberOfPacketsReceived() to monitor data usage? 来源: https:/

Can I open a “.pdf” document on a blackberry using java?

本秂侑毒 提交于 2019-12-01 08:57:39
问题 Can I open a ".pdf" document on a blackberry using java? If yes, then how? 回答1: theres nothin native in blackberry to load pdf files, but you can achieve that loading google viewer inside your Browser field, that will do the trick! =D! public ScrLoad() { String url = "http://docs.google.com/gview?embedded=true&url=http://prueba.agenciareforma.com/appiphone/android/elnorte.pdf"; add(new BrowserField(url)); } Google Docs Viewer http://docs.google.com/gview 回答2: The BB doesn't have a built-in

Reading text file in J2ME

与世无争的帅哥 提交于 2019-12-01 08:35:43
I'm trying to read a resource (asdf.txt), but if the file is bigger than 5000 bytes, (for example) 4700 pieces of null-character inserted to the end of the content variable. Is there any way to remove them? (or to set the right size of the buffer?) Here is the code: String content = ""; try { InputStream in = this.getClass().getResourceAsStream("asdf.txt"); byte[] buffer = new byte[5000]; while (in.read(buffer) != -1) { content += new String(buffer); } } catch (Exception e) { e.printStackTrace(); } The simplest way is to do the correct thing: Use a Reader to read text data: String content = ""