Search Results

Search found 355 results on 15 pages for 'j2me newbiew'.

Page 8/15 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • java.net.SocketException: Software caused connection abort: socket write error

    - by npinti
    Hi guys, I am trying to send an image from a Java desktop application to a J2ME application. The problem is that I am getting this exception: java.net.SocketException: Software caused connection abort: socket write error I have looked around on the net, and although this problem is not that rare, I was unable to find a concrete solution. I am transforming the image into a byte array before transferring it. These are the methods found on the desktop application and on the J2ME respectively public void send(String ID, byte[] serverMessage) throws Exception { //Get the IP and Port of the person to which the message is to be sent. String[] connectionDetails = this.userDetails.get(ID).split(","); Socket sock = new Socket(InetAddress.getByName(connectionDetails[0]), Integer.parseInt(connectionDetails[1])); OutputStream os = sock.getOutputStream(); for (int i = 0; i < serverMessage.length; i++) { os.write((int) serverMessage[i]); } os.flush(); os.close(); sock.close(); } private void read(final StreamConnection slaveSock) { Runnable runnable = new Runnable() { public void run() { try { DataInputStream dataInputStream = slaveSock.openDataInputStream(); int inputChar; StringBuffer results = new StringBuffer(); while ( (inputChar = dataInputStream.read()) != -1) { results.append((char) inputChar); } dataInputStream.close(); slaveSock.close(); parseMessage(results.toString()); results = null; } catch(Exception e) { e.printStackTrace(); Alert alertMsg = new Alert("Error", "An error has occured while reading a message from the server:\n" + e.getMessage(), null, AlertType.ERROR); alertMsg.setTimeout(Alert.FOREVER); myDisplay.setCurrent(alertMsg, resultScreen); } } }; new Thread(runnable).start(); } I am sending the message across a LAN, and I have no problems when I send short text messages instead of images. Also, I used wireshark and it seems that the desktop application is only sending part of the message. Any help would be highly appreciated. Also, everything works on the J2ME simulator. Thanks.

    Read the article

  • Getting .jar file onto a mobile phone error

    - by me123
    Hello, I am trying to get a .jar file onto my mobile device. I have written a j2me application and I want to get it onto my phone. I have developed it in eclipse galileo and I export my project folder to a jar. When I try to download the jar file from the internet onto my phone I get an "incorrect description" error. Does anyone know how to get a j2me application onto a mobile device or why I may be getting this error? Thanks in advance.

    Read the article

  • Protobuf compiler for several languages

    - by Stipa
    Hi, In my project I have components written on Python, ObjectiveC and J2ME. I want to use protobuf as data interchange format. However, there are one issue I need to resolve. Google implementation doesn't support ObjC and J2ME. There are 3rd party implementations that supports those languages. But I really don't want to be depended of several protoc implementations. What is the best way for me to have protobufs for several languages? Do I need to use different compilers or there is other option? Thanks, -Lev

    Read the article

  • J2ME web service client

    - by Wasim
    Hi all , I started to use the Netbeans 6.8 web service client wizard . I created a web service (.Net web service) witch return an object Data. The Data class , contains fileds with many types : int , string , double , Person object and array of Person object. I created the J2ME client code through the wizard and every thing seems ok . I see in the Netbeans project the service and the stub . When I try to call my web service method , say Data GetData() ; Then I have a problem with parsing the returned data from the web service and the client data object . As follows : After finishing to call the web service method , in the stub code : public Data helloWorld() throws java.rmi.RemoteException { Object inputObject[] = new Object[] { }; Operation op = Operation.newInstance( _qname_operation_HelloWorld, _type_HelloWorld, _type_HelloWorldResponse ); _prepOperation( op ); op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/HelloWorld" ); Object resultObj; try { resultObj = op.invoke( inputObject ); } catch( JAXRPCException e ) { Throwable cause = e.getLinkedCause(); if( cause instanceof java.rmi.RemoteException ) { throw (java.rmi.RemoteException) cause; } throw e; } return Data_fromObject((Object[])resultObj); } private static Data Data_fromObject( Object obj[] ) { if(obj == null) return null; Data result = new Data(); result.setIntData(((Integer )obj[0]).intValue()); result.setStringData((String )obj[1]); result.setDoubleData(((Double )obj[2]).doubleValue()); return result; } I debug the code and in Run time resultObj has one element witc is an array of the Data object , so in parsing the values in the Data_fromObject method it expect many cells like we see in the code obj[0] , obj[1] , obj [2] but in realtime it has obj[0][0] , obj[0][1] , obj[0][2] What can be the problem , how can check the code generation issue ? Is it a problem with the web service side. Please help. Thanks in advance...

    Read the article

  • Data in J2ME RecordStore does not persist across sessions

    - by Botond Balázs
    I'm building a mobile app with J2ME, and I've found that the data I write into a RecordStore can be accessed while the program is still running but it is lost after quitting and restarting it. No exception is thrown, the data is simply lost. UPDATE: Thanks everyone for your suggestions. I'm using NetBeans on Windows 7. I'm not sure if it is using the WTK version I have previously installed or another one it has installed somewhere else. I've checked my WTK folder for the files Pavel wrote about, but couldn't find them. Now I'm testing the features requiring persistence on my phone and everything else in the emulator, but it would of course be much better to be able to test everything in the emulator. private RecordStore recordStore = null; public MyMIDlet() { readStuff(); // output: nothing found in recordStore :( saveStuff(); readStuff(); // output: stuff } private void readStuff() { try { recordStore = RecordStore.openRecordStore(REC_STORE, true); int n = recordStore.getNumRecords(); String stuff; if (n == 0) { stuff = "nothing found in recordStore :("; } else { stuff = new String(recordStore.getRecord(1)); } System.out.println(stuff); } catch (Exception e) { System.out.println("Exception occured in readStuff: " + e.getMessage()); } finally { if (recordStore != null) { try { recordStore.closeRecordStore(); } catch (Exception e) { // ignore } } } } private void saveStuff() { try { recordStore = RecordStore.openRecordStore(REC_STORE, true); int n = recordStore.getNumRecords(); byte[] stuff = "stuff".getBytes(); recordStore.addRecord(stuff, 0, stuff.length); } catch (Exception e) { System.out.println("Exception occured in saveStuff: " + e.getMessage()); } finally { if (recordStore != null) { try { recordStore.closeRecordStore(); } catch (Exception e) { // ignore } } } }

    Read the article

  • Using RecordStore in Java J2ME

    - by me123
    Hi, I am currently doing some J2ME development. I am having a problem in that a user can add and remove elements to the record store, and if a record gets deleted, then that record is left empty and the others don't move up one. I'm trying to come up with a loop that will check if a record has anything in it (incase it has been deleted) and if it does then I want to add the contents of that record to a list. My code is similar to as follows: for (int i = 1; i <= rs.getNumRecords(); i++) { // Re-allocate if necessary if (rs.getRecordSize(i) > recData.length) recData = new byte[rs.getRecordSize(i)]; len = rs.getRecord(i, recData, 0); st = new String(recData, 0, len); System.out.println("Record #" + i + ": " + new String(recData, 0, len)); System.out.println("------------------------------"); if(st != null) { list.insert(i-1, st, null); } } When it gets to rs.getRecordSize(i), I always get a "javax.microedition.rms.InvalidRecordIDException: error finding record". I know this is due to the record being empty but I can't think of a way to get around this problem. Any help would be much appreciated. Thanks in advance.

    Read the article

  • J2ME cache issue

    - by kiennt
    I have to write a J2ME app to retrieve images from server and display in mobile phone. I have seen and test that Snaptu have a mechanism to cache image, event with 100 images (both normal size and zoom size). I wonder how they can do that? I though that those guys use rms to save image stream to data. But when i check in working folder of simulater( I use Windows XP and Sun Wireless Toolkit 3.0, the Emulator device i use to run my program is CLDC Device 1 - my working folder is C:\Document And Settings\Administrator\javame-sdk\3.0\work\6\appdb), i see some .db file. When i delete these files, i still can view cache image in my emulator???? I also thought that those guys use heap memory to save image. But it is not correct because when i set limit device memory is 2MB (like some mobile phones), and i load and view 100 images in zoom size, it didn't make OutOfMemory Error? It so weird. Any one can help me? Thanks

    Read the article

  • Help in J2ME for creating image and parse it

    - by HAMED
    Can anyone tell me how i can parse a png image into many png images in J2ME??? for examole:I just wnat to have a source image 150*150 pixel and parse it to 10 image with 15*15 pixel. I write an elemantary code that have exeption. This is my code: public class HelloMIDlet extends MIDlet implements CommandListener { private boolean midletPaused = false; private Command exitCommand; private Form form; private StringItem stringItem; Image im , im2; Form form1 = null; public HelloMIDlet() { try { // create source image im = Image.createImage("/image1.JPG"); int height = im.getHeight() ; int width = im.getWidth() ; int x = 0 ; int y = 0 ; while ( y < height ){ while ( x < width ){ // create 15*15 pixel of source image im2 = im.createImage(im, x, y, 15, 15, Sprite.TRANS_NONE) ; x += 15 ; } y += 15 ; x = 0 ; } } catch (IOException ex) { ex.printStackTrace(); } } please help me to make it right....It's emergency! Thanks a lot guys...

    Read the article

  • Parsing data from txt file in J2ME

    - by CSFYPMAIL
    Basically I'm creating an indoor navigation system in J2ME. I've put the location details in a .txt file i.e. Locations names and their coordinates. Edges with respective start node and end node as well as the weight (length of the node). I put both details in the same file so users dont have to download multiple files to get their map working (it could become time consuming and seem complex). So what i did is to seperate the deferent details by typing out location Names and coordinates first, After that I seperated that section from the next section which is the edges by drawing a line with multiple underscores. Now the problem I'm having is parsing the different details into seperate arrays by setting up a command (while manually tokenizing the input stream) to check wether the the next token is an underscore. If it is, (in pseudocode terms), move to the next line in the stream, create a new array and fill it up with the next set of details. I found a some explanation/code HERE that does something similar but still parses into one array, although it manually tokenizes the input. Any ideas on what to do? Thanks Text File Explanation The text has the following format... <--1stSection--  /**   * Section one has the following format   * xCoordinate;yCoordinate;LocationName   */ 12;13;New York City 40;12;Washington D.C. ...e.t.c _________________________ <--(underscore divider) <--2ndSection--  /**   * Its actually an adjacency list but indirectly provides "edge" details.   * Its in this form   * StartNode/MainReferencePoint;Endnode1;distance2endNode1;Endnode2;distance2endNode2;...e.t.c   */ philadelphia;Washington D.C.;7;New York City;2 New York City;Florida;24;Illinois;71 ...e.t.c

    Read the article

  • White screen between Canvases

    - by user315647
    Hello everyone, I am having, what i believe is a minor issue. I am developing a J2ME application which predominantly uses canvases for display. The problem is I have set all these canvases to fullscreen and when i navigate from one class to another i am first given a white screen and then taken to the canvas i intend to go. I am not understanding what i am doing wrong I am using the following statement for navigation javax.microedition.lcdui.Display.getDisplay(MIDlet).setCurrent(Canvas); Please help!!

    Read the article

  • jad for blackberry non-midlet application

    - by Durgesh
    Hi Experts, I am writing a regular application for Blackberry. I want to know, is there anything similiar to JAD for pure native blackberry application (no j2me) ? If JAD is applicable to regular BB app then please guide me to use JAD for it. Kind Regards -Durgesh O Mishra

    Read the article

  • Detecting dropped call in Mobile

    - by Wasim
    Hi all , I'm using Motorola device and developed it with J2ME . I'm searching for a functionality to detect incomming or outcomming calls when dropped . I mean , when the call is dropped I need to recognize this event. Thanks

    Read the article

  • Facebook Login Api

    - by shyam
    I am developing a mobile application that let users post pictures to facebook in J2ME. For this within the app I am collecting user's facebook username and password. How can I use these login credentials to post pictures to facebook. I came across http://code.google.com/p/facebook-java-api/ but will this allow me to do the same? I have used nokia community software that does this. Please Help

    Read the article

  • Problem on creating font using a custom ant task, which extends LWUIT's FontTask.

    - by Smithy
    Hi. I am new to LWUIT and j2me, and I am building a j2me application for showing Japanese text vertically. The phonetic symbol part of the text should be shown in relatively small font size (about half the size of the text), small Kanas need to be shown as normal ones, and some 'vertical only' characters need to be put into the Private Use Area, etc. I tried to build this font into a bitmap font using the FontTask ant task LWUIT provided, but found that it does support the customizations mentioned above. So I decided to write my own task and add those. Below is what I have achieved: 1 An ant task extending the LWUITTask task to support a new nested element <verticalfont>. public class VerticalFontBuildTask extends LWUITTask { public void addVerticalfont(VerticalFontTask anVerticalFont) { super.addFont(anVerticalFont); } } 2 The VerticalFontTask task, which extends the original FontTask. Instead of inserting a EditorFont object, it inserts a VerticalEditorFont object(derived from EditorFont) into the resource. public class VerticalFontTask extends FontTask { // some constants are omitted public VerticalFontTask() { StringBuilder sb = new StringBuilder(); sb.append(UPPER_ALPHABET); sb.append(UPPER_ALPHABET.toLowerCase()); sb.append(HALFWIDTH); sb.append(HIRAGANA); sb.append(HIRAGANA_SMALL); sb.append(KATAKANA); sb.append(KATAKANA_SMALL); sb.append(WIDE); this.setCharset(sb.toString()); } @Override public void addToResources(EditableResources e) { log("Putting rigged font into resource..."); super.addToResources(e); //antialias settings Object aa = this.isAntiAliasing() ? RenderingHints.VALUE_TEXT_ANTIALIAS_ON :RenderingHints.VALUE_TEXT_ANTIALIAS_OFF; VerticalEditorFont ft = new VerticalEditorFont( Font.createSystemFont( this.systemFace, this.systemStyle, this.systemSize), null, getLogicalName(), isCreateBitmap(), aa, getCharset()); e.setFont(getName(), ft); } VerticalEditorFont is just a bunch of methods logging to output and call the super. I am still trying to figure out how to extend it. But things are not going well: none of the methods on the VerticalEditorFont object get called when executing this task. My questions are: 1 where did I do wrong? 2 I want to embed a truetype font to support larger screens. I only need a small part of the font inside my application and I don't want it to carry a font resource weighing 1~2MB. Is there a way to extract only the characters needed and pack them into LWUIT?

    Read the article

  • Which messaging interfaces can BlackBerry apps modify?

    - by humble coffee
    Does the native Blackberry API allow for the modification of any messaging interface? For example, I'd like to be able to build an app that added a button at the bottom of a received message which says 'translate this'. I've heard that this kind of thing is possible using J2ME plus the native BlackBerry API. Can this be done for all kinds of messages, eg SMS, email and BB messaging? The translation aspect is not relevant, it just provides the context for the kind of feature I'm after.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >