Sudoku in J2ME

Hi guys,
I am trying to fix a problem wit a MIDlet I have... jus want to know a way of drawing fixed numbers onto the Sudoku grid using an Array...

Yea I know I could do it like that..... but there is a way of doing it with 2D Arrays and am not sure how to do it that way...
The numbers entered onto the grid is determined by an Array... so in the same way the fixed numbers should be able to be displayed with an Array.... I made an attempt as follows....
public Cell(String s) {
int i, j;
SMatrix = new byte[9][9];
fixedNumber = new boolean[9][9];
for (i = 0; i < 9; i++)
for (j = 0; j < 9; j++)
SMatrix[i][j] = draw.String (""+......, x, y, 16|4);
if (SMatrix[i][j] > 10)
fixedNumber[i][j] = true;
SMatrix[i][j] -= 10;
else
SMatrix[i][j] = 0;
fixedNumber[i][j] = false;
}

Similar Messages

  • Looking for All-In-One Sudoku Game App for iPad?

    Bare with me...  I'm going to learn now if this is an appropriate question here and if not where to go that would be appropriate?
    I'm looking for a great iPad Sudoku game app that offers a variety of different format variations using numbers 1-9, different colors, and different shapes--that sort of thing...instead of just the common numbers.  I'm not concerned about scoring the game or tracking time or the leaderboard stuff.
    I've looked and found a gillion to consider including Google and looked at some for more detail but so far have found none...and maybe none exist or maybe I'll have to settle for two or three separate Sudoku games to fullfill what I'm after?
    So maybe someone in the community knows of just the Sudoku app I'm looking for?
    Thank you.

    A quick Google search provided the following:  http://itunes.apple.com/us/app/sudoku-hd-for-ipad/id364909963?mt=8
    I don't know if it offers exactly what you want, but you can check the App Store, or you can go to Google and type the following in your search bar:  apple sodoku app ipad
    Several options will come up.

  • Send email from j2me through servlet

    Hi people,
    i hope you can help me because i am new in network programming.
    I am trying to send email from j2me to googlemail account I have 2 classes EmailMidlet (which has been tested with wireless Toolkit 2.5.2 and it works) and the second class is the servlet-class named EmailServlet:
    when i call the EmailServlet, i get on the console:
    Server: 220 mx.google.com ESMTP g28sm19313024fkg.21
    Server: 250 mx.google.com at your service
    this is the code of my EmailServlet
    import java.io.*;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.text.*;
    import java.util.Date;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class EmailServlet extends HttpServlet {
       public void doPost(HttpServletRequest request, HttpServletResponse response)
             throws IOException, ServletException {
          System.out.println("____emailservlet.doPost");
          response.setContentType("text/plain");
          PrintWriter out = response.getWriter();
          System.out.println("______________________________");
          out.println();
          String to = request.getParameter("to");
          System.out.println("____________________________to" + to);
          String subject = request.getParameter("subject");
          String msg = request.getParameter("msg");
          // construct an instance of EmailSender
          System.out.println("servlet_to" + to);
          send("[email protected]", to, subject, msg);
          out.println("mail sent....");
       public void send(String from, String to, String subject, String msg) {
          Socket smtpSocket = null;
          DataOutputStream os = null;
          DataInputStream is = null;
          try {
             smtpSocket = new Socket("smtp.googlemail.com", 25);
             os = new DataOutputStream(smtpSocket.getOutputStream());
             is = new DataInputStream(smtpSocket.getInputStream());
          } catch (UnknownHostException e) {
             System.err.println("Don't know about host: hostname");
          } catch (IOException e) {
             System.err
                   .println("Couldn't get I/O for the connection to: hostname");
          if (smtpSocket != null && os != null && is != null) {
             try {
                os.writeBytes("HELO there" + "\r\n");
                os.writeBytes("MAIL FROM: " + from + "\r\n");
                os.writeBytes("RCPT TO: " + to + "\r\n");
                os.writeBytes("DATA\r\n");
                os.writeBytes("Date: " + new Date() + "\r\n"); // stamp the msg
                                                    // with date
                os.writeBytes("From: " + from + "\r\n");
                os.writeBytes("To: " + to + "\r\n");
                os.writeBytes("Subject: " + subject + "\r\n");
                os.writeBytes(msg + "\r\n"); // message body
                os.writeBytes(".\r\n");
                os.writeBytes("QUIT\r\n");
                // debugging
                String responseLine;
                while ((responseLine = is.readLine()) != null) {
                   System.out.println("Server: " + responseLine);
                   if (responseLine.indexOf("delivery") != -1) {
                      break;
                os.close();
                is.close();
                smtpSocket.close();
             } catch (UnknownHostException e) {
                System.err.println("Trying to connect to unknown host: " + e);
             } catch (IOException e) {
                System.err.println("IOException: " + e);
       } 1.when i print "to" in EmailServlet also:
      String to = request.getParameter("to");
          System.out.println("____________________________to" + to);  it show null on the console :confused:
    2. ist this right in case of googlemail.com?
      smtpSocket = new Socket("smtp.googlemail.com", 25);  I would be very grateful if somebody can help me.

    jackofall
    Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this thread now.
    db

  • J2me and java card, need help to communicate

    we are trying to put together a reader to read smartcards using j2me and we figure that it would be easiest if we could develop it to work with java cards rather than standard smart cards, the problem is we get garbage when we communicate to it, the chip sends us crap, any suggestions what might be wrong, any calls we might be missing, has anyone worked with j2me and java cards or smart cards, any help would be appreciated.
    einar

    .... reader app and the ME behind it .... smells like mobile ....
    First of all - if you want to have one mobile application running on this just make sure that whatever is written in ME can use drivers from the reader chip ....
    Workin on the PC is something completely different. There was one good example how to develop one host application in Java provided with the JCOP tools long ago ... I don't know if this is now in the new Eclipse tools.
    But - there was a small API provided that can give you good hints what to do - and - once you have it on the reader side - you can easily integrate ME methods with this ...

  • Image Processing in j2me

    Hi All,
    I want to do image processing in mobile application(j2me).
    But there are not enough java packages in mobile environment.
    How to do it please let me know if any body knows.
    Thanks.

    brightness: convert every RGB pixel to HSB -> increase luminance by constant value -> convert back to RGB
    contrast: convert every RGB pixel to HSB -> multiply luminance by constant value-> convert back to RGB
    You can also do both in one go.

  • UTF-8 encoding in J2ME

    Hello,
    I'm currently developing J2ME application for downloading bus schedules.
    The data that I download is in polish language (eg. bus directions, stop names etc). These are xml files generated by a php script encoded in UTF-8.
    The problem is that I don't know how to display that properly, so that all the polish characters are what they're supposed to be.
    Some of my code for downloading content:
    String getXML(String url)
            HttpConnection cn = null;
            InputStream str = null;
            //DataInputStream strd = null;
            StringBuffer sb = null;
            try
                int code;
                cn = (HttpConnection) Connector.open(url);
                code = cn.getResponseCode();
                if (code == HttpConnection.HTTP_OK)
                    str = cn.openInputStream();
                    // strd = new DataInputStream(str);
                    sb = new StringBuffer();
                    InputStreamReader r = new InputStreamReader(str, "UTF-8");
                    int total = 0;
                    int read = 0;
                    while ((read = r.read()) >= 0)
                        total++;
                        sb.append((char) read);
                    return sb.toString();
                else
                    throw new Exception("Nie uda&#322;o si&#281; po&#322;&#261;czy&#263; z serwerem");
            catch (Exception e)
                return null;
            finally
                try
                    if (str != null)
                        str.close();
                    if (cn != null)
                        cn.close();
                catch (Exception e)
        }And parsing it:
    InputStreamReader reader = null;
                    String xml = getScheduleXML(getSel_Line(), null, null);
                    ByteArrayInputStream stream = new ByteArrayInputStream(xml.getBytes());
                    reader = new InputStreamReader(stream, "UTF-8");
                    parser.setInput(reader);
                    while (parser.next() != KXmlParser.END_DOCUMENT)
                        if ((parser.getEventType() == KXmlParser.START_TAG) && (parser.getName().equalsIgnoreCase("direction")))
                                String d = (String) parser.getAttributeValue(0);
                                v.addElement(d);
                                String d2 = (String) parser.getAttributeValue(1);
                                v2.addElement(d2);
                    }What do I do wrong? What is missing?

    Problem solved. I had to add "UTF-8" parameter to getBytes method.

  • How to send sms from gsm modem(AT commands) to j2me application(not inbox)

    hi
    i want to send sms from gsm modem to a j2me application, for this to happen i have to send sms to a specific port in which j2me application is running.when i m trying to send sms from modem it doesnt go to application it goes to inbox.
    is it related to udh settings if yes then how do i set port no in settings?if no what are the other ways.

    Hi Vignesh,
    Might be you can call ActiveX or DLL objects of the software installed for modem from LabVIEW, if it is unblocked.
    Have a  look on the link > http://zone.ni.com/devzone/cda/tut/p/id/2983
    CLA 2014
    CCVID 2014

  • Problem with Display.setCurrentItem() using J2ME-Polish

    Hi,
    I am fairly new to J2ME-polish and have encountered a situation that I am having a problem with. I am loading a form with a number of String Items. When I display the form I would like to focus to the last String Item that has been placed on the form. I have been using Display.setCurrentItem() in J2ME but when I try using it in J2ME-Polish I receive this message :"de.enough.polish.ui.Screen (3022): Screen: unable to focus item (did not find it in the container or is not activatable ) "
    Below is a snippet of my code.
            // si14 in a StringItem defined earlier in the code
            // It is the last stringItem placed into the form
            form.append(si14);
            display = Display.getDisplay(this);
         display.setCurrent(form);
         display.setCurrentItem(form.get(0));Thanks

    http://forums.sun.com/thread.jspa?threadID=686256&messageID=10864566

  • How to get the Mobile information by using J2ME application

    hi all,
    I am lakshman.I am developing an application in j2me,I want my program compatible to all mobile devices.
    I want to know properties and the device information with the help of a j2me application.I got the information with the help of System.getProperty(String).I found some of the information like sms,videocapture,and some of the values and the variables ... in the following
    platform...null
    encoding...ISO-8859-1
    configuration...CLDC-1.0
    profile...MIDP-2.0
    locale...null
    fileconnection...1.0
    comport...null
    hostname...iwmc-07
    sms...null
    smartcard...null
    location version...null
    sip version...null
    m3gversion...null
    mms...null
    videocapture...false
    videoencoding...null
    snapshotencoding...encoding=png encoding=jpeg encoding=gif encoding=bmp
    audioencoding...null
    supaudcap...false
    suprecod...false
    supmixing...false
    mediaversion...1.1
    streamcont...null
    I want to know these are the only variables or is there are lot...
    Now my question is I want to get the information of the service provider and also the present location that the mobile was present.I think there was some method to get that ...I want to get what firmware it was using .
    Can anybody tell me that way and also the package to get the information
    thanks in advance
    lakshman

    hi all,
    I am lakshman,I found the answer for my question,By using the Location API(jsr179).It was not include in the WTK2.2.for that i have downloaded the WTK2.3 then i have implemented the location api in the application and it was working.
    And I have the following warning...
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.
    I am running the application from my Emulator(by using the default color phone).I have to check that in the device.
    Can any body please give me the way to fix that,i want to test my application from my emulator is that is possible if possible ...how?.what is the procedure to implement..
    thanks in advance

  • Sending an email through J2ME

    What is the easiest way to send an email to an email account using J2ME?
    I browsed google, and all of the results appeared very complex. Is there a simple way to do it (like you can with PHP)?
    Thanks!

    My phone doesn't have a mobile mailer.
    I can't believe emailing is so difficult!
    Would this solution work:
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.*;
    public class Emailer
         String url;
         String to;
         String from;
         String subj;
         String msg;
         HttpConnection conn;
         OutputStream output;
         public Emailer(String url, String to, String from, String password,
                                                String subj)
              this.url = url;
              this.to = to;
              this.from = from+"/"+password;
              this.subj = subj;
         public boolean sendEmail(String msg)
              this.msg = msg;
              try
                   StringBuffer buffer = new StringBuffer();
                   buffer.append("To: " + to);
                   buffer.append("From: " + from);
                   buffer.append("Subject: " + subj);
                   buffer.append("Message: " + msg);
                   conn = (HttpConnection) Connector.open(url);
                   conn.setRequestMethod(HttpConnection.POST);
                   output = conn.openOutputStream();
                   int i = 0;
                   char c;
                   while((c = buffer.charAt(i)) != 0)
                        output.write(c);
                        i++;
              catch (Exception e)
                   return false;
              return true;
    }I tried it, but I never got the email...
    Also, is there a simple way to read from .txt files?
    Thanks!

  • How to set up on device debuging with J2ME SDK 3.0 and window mobile 6.5?

    I got some infomation about setting up on device debuging in J2ME SDK 3.0 with real device(e.g samsung windown mobile B7330). When I start debuging on device, I got exception when open RMS
    javax.microedition.rms.RecordStoreException: error opening record store fileHere my code:
    public void saveProfile() {
            byte[] data = toByteArray();
            try {
                rs = RecordStore.openRecordStore("kunkunProfile", true);
                for (RecordEnumeration e = rs.enumerateRecords(null, null, false); e.hasNextElement();) {
                    int id = e.nextRecordId();
                    rs.deleteRecord(id);
                rs.addRecord(data, 0, data.length);
                rs.closeRecordStore();
            } catch (Exception ex) {
                System.out.println("Exception in OpenRecordStore..." + ex.getMessage());
                try {
                    rs.addRecord(data, 0, data.length);
                    rs.closeRecordStore();
                } catch (Exception e) {
                ex.printStackTrace();
        }Anybody help me? I am stuck here.

    Hi dominikg,
    At first, You can try to restart the device-manager from system tray.
    If it doesn't help, then try the following:
    - stop the device manager
    - Remove c:\Docement and Settings\<your User>\javame-sdk folder.
    - Ran the device manager from <SDK>/bin directory
    - try to debug again.
    Did you tried to change port 51307 to another.
    Early access build had some problems with device manager, I hope that final release will be better :)
    BR,
    Igor

  • How to print directly to printer using USB and Bluetooth from Java (J2ME) app.

    I write mobile phone apps in Java (J2ME). I want to print directly to a printer via USB and via Bluetooth. I cannot use a print job with the Java available to me. Once upon a time you could just send text and print control characters to a printer. I would like to be able to do that again. Alternatively could you provide a 'skeleton' data stream into which I could insert my code to produce what is sent to the printer when a print job is used with Java on a laptop or PC. I just want to sent simple text with a little formatting. 

    Hi,
    As far as printing to devices not all devices support Bluetooth. Many devices support Bonjour protocal, IPP. The main print port is 9100. Additionally you can see what IO protocols are supported on a product by looking at the EWS (Embedded WebServer) there should be a networking page with that information.  Port 9100 is your basic print port and different devices will support different formats (PDF, JPEG, PCL5, PCL6). If there is an API you can find (i am not familiar with J2ME availible calls, then you can use those and send the data to port 9100. Again that is the basic path most printers will accept. not all devices support bonjour not all device support bluetooth etc... Hope that helps and good luck.
    I am an HP Employee.

  • How to connect the EJB webservices using kxmlrpc in J2ME

    Hi all,
    I am trying to develope a program in J2ME using kxmlrpc. I am having the EJB web serivce as server and its working fine , the webservice coding is as follows and i am using Sun application sever for web services
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import javax.ejb.EJBException;
    import javax.ejb.Stateless;
    import javax.jws.WebService;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.sql.*;
    @Stateless()
    @WebService()
    public class test1 {
    /* Sample Web Service Operation */
    @WebMethod(operationName="sample_operation")
    public String operation(@WebParam(name="param_name") String param) {
    // implement the web service operation here
    System.out.println("test the xml rpc");
    param="helloworld";
    return param;
    Any body please help me how to call this web sevices method in J2ME client using kxmlrpc, i tried but it shows execption. And i want to know which url i want ot give inthe XmlRpcclient() and what are all the parameters to be given in xmlrpcclient.execute(). Anybody please help me on this and my kxml coding is as follows:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.*;
    import org.kxmlrpc.*;
    public class kxmlrpc_demo extends MIDlet implements CommandListener {
    private List list;
    private Command exitCommand;
    private String[] menuItems;
    private Display display;
    private Alert response;
    private XmlRpcClient xmlrpc;
    private Vector params, xmlArray;
    public kxmlrpc_demo() {
    //Initialize the User Interface
    menuItems = new String[] {"Timestamp", "Randomizer", "AddressBook"};
    list = new List( "Select a service", List.IMPLICIT, menuItems, null );
    exitCommand = new Command( "Exit", Command.EXIT, 1 );
    response = new Alert("Service Return", null, null, AlertType.INFO);
    response.setTimeout( Alert.FOREVER );
    //Add commands
    list.addCommand( exitCommand );
    list.setCommandListener( this );
    //obtain a reference to the device's UI
    display = Display.getDisplay( this );
    }//end MyMidlet()
    public void startApp() {
    display.setCurrent( list );
    }//end startApp()
    public void pauseApp() {
    }//end pauseApp()
    public void destroyApp( boolean unconditional ) {
    //clean up
    list = null;
    exitCommand = null;
    display = null;
    }//end destroyApp
    public void commandAction( Command com, Displayable dis ) {
    if ( dis == list && com == List.SELECT_COMMAND ) {
    switch( list.getSelectedIndex() )
    case 0:
    try
    xmlrpc = new XmlRpcClient( "http://localhost:4116/test1Service/test1?Tester" );
    params = new Vector();
    String serverTime = (String) xmlrpc.execute( "sysTime.getSystemTime", params );
    response.setString( serverTime.toString() );
    display.setCurrent( response );
    catch ( Exception ex )
    response.setString( ex.toString() );
    ex.printStackTrace(); // DEBUG
    display.setCurrent( response );
    }//end try/catch
    break;
    case 1:
    try
    xmlrpc = new XmlRpcClient( "http://localhost:4116/test1Service/test1?Tester" );
    System.out.println("url"+xmlrpc.getURL());
    params = new Vector();
    xmlArray = new Vector();
    xmlArray.addElement( "param_name" );
    // xmlArray.addElement( "5" );
    // xmlArray.addElement( "12" );
    params.addElement( xmlArray );
    String serverTime = (String) xmlrpc.execute( "sample-operation", params);
    System.out.println("servertime: "+serverTime);
    response.setString( serverTime.toString() );
    display.setCurrent( response );
    catch ( Exception ex )
    response.setString( ex.toString() );
    ex.printStackTrace(); // DEBUG
    display.setCurrent( response );
    }//end try/catch
    break;
    case 2:
    response.setString( "Not implemented yet." );
    display.setCurrent( response );
    break;
    }//end switch( list.getSelectedIndex() )
    else if ( com == exitCommand ) {
    destroyApp( true );
    notifyDestroyed();
    }//end if ( dis == list && com == List.SELECT_COMMAND )
    }//end CommandAction( Command, Displayable )
    }//end MyMidlet
    Thanks in advance.
    regards
    Senthil K

    Any body please help me on this. I am really struggling on this

  • Is there *any* way to ping MIDlet using default SMS/call (j2me)

    Hi,
    I'm writing a server style MIDlet which is polling a bluetooth device, the nature of the server is such that the phone running the MIDlet (in my case, a Motorola L6) is dedicated, it needs do nothing other than run the server, it is assumed it will not be used for anything else. Specifically the only phone calls or SMS messages it receives should be specific ping requests to server. The server will run 24/7, and should be resistant to being suspended by incoming calls (I've noted this could be a problem in itself).
    All I really want is for a 3rd party, without any special client software, to be able to ping the server (prompt it) to dispatch a set of text data to a pre-defined phone number via SMS (using WMA TextMessage).
    Basically someone should be able to set up the server, and then, with any phone (with no specific client MIDlet installed), be able to call or SMS the server and get a response posted back (to a fixed number, not necessarily to originating phone number).
    Does anyone know any way, no matter how hacky (needn't be pretty), to achieve this? You cannot receive SMS notifications on default port. An incoming call will call pauseApp which I could use - but not resume it, so server remains suspended. There are ways around having app suspended on receipt of call/SMS, but they involve never receiving the pauseApp notification, so I'm back to square one. I've wondered if I could check the free disk space on the MIDP profile (somehow) to 'detect' when it reduces in size, thus suggesting an SMS must have come in. Can a user send an SMS to a specific port with standard SMS-send interface (certainly can't see how myself, as no ':' character available). Can you hack the phone to re-route incoming SMS messages to something other than the default port?
    Is there a specific phone that might do this (I just need a phone supporting j2me bluetooth API, needn't be motorola L6)?.
    I think this can be done with Symbian (of which I know very little), and ultimately I might need to start programming with that, but I'd really prefer to continue using j2me..
    Any ideas would be greatly appreciated, I've spent a fair bit of time trolling for answers with only limited success.
    Cheers
    Edited by: bbloff on Oct 10, 2007 8:50 PM

    The tunnel default gateway is needed to let the internal firewall and router handle the routing for all decrypted IPsec packets. Today, after a Cisco IOS? EasyVPN Client connects to a Cisco IOS EasyVPN Server, there is no simple way for the client to send the tunnel traffic to the internal corporate network (other than to have the entire routing table on the IPsec gateway). In this type of implementation, the Cisco IOS routers use the default gateway to route all packets toward the Internet that do not have a more specific route. The tunnel default gateway gives customers the flexibility to control how they handle IPsec tunneled traffic

  • How to map lattitude and longitude on a map in j2me.

    hi all,
    i am new to this forum and new to j2me.
    i am developing a pplication to track location of a gps mobile phone.
    i am using wtk2.5.1 jsr179 to develop it
    i know how to get location of a mobile phone but i cant find any method how to map those lat long coordinates on a map...
    please help me out if anyone knows about it..
    thanx

    Hi,
    I'm afraid that this is large problem... and it's not related to J2ME.
    The first question is whether you want to use some map provider and its API or you have a bitmap and you want to place a cursor of your position in the map.
    In the first case find an API to use (I don't know any). In the second case you have to understand what the GPS coordination mean, know projection type of the used map, then find and use the transformation formulas to transform GPS coordinates to map coordinates and vice versa.
    Regarding the GPS coordinates start here: http://en.wikipedia.org/wiki/World_Geodetic_System
    Regarding the projections - my map I tried to use in my application uses Lambert conic conformal projection http://en.wikipedia.org/wiki/Lambert_conformal_conic_projection
    but it may differ from map to map.
    Enjoy :-)
    Rada

Maybe you are looking for

  • IPod reloads entire video file when I make changes to video's info?

    Just got the 80GB video for Xmas. When I sync after making changes to the info data (name, category, year etc) in iTunes, the entire movie "reloads", as if I am syncing a movie to the iPod that I've never synced before. It overwrites the older versio

  • How does Find My iPod work..

    If Find My iPod needs a Wifi connection to work, how will it be able to be locked/wiped/tracked if it doesn't have a internet connection. And iPods don't automatically connect to wifi connections. Whats the point of it. My iPod was stolen and I'm thi

  • Are Crystal 9 and Crystal 10 supported with Windows 7?

    I have Crystal 9 installed for Peoplesoft report development and Crystal 10 installed for Kronos report development.  We are moving to Windows 7 and I am doing testing of all our applications and third party tools now.  What I am finding is that both

  • LR4 downloaded but won't install?

    LR4 downloaded but won't install?

  • Opening certain pdf's to combine

    My Adobe Reader will not permit me to open and combine some pdf's if they were sent via email as it says they are not "decoded." Is there a setting where I can disable that so I can combine these files?