E-mail Info curve8310 using Java BlackBerry GPS

Here is the code for blackberry GPS information sent to an e-mail address. The code uses sleep to send information at intervals.

My problem is that when once that the GPS goes out of scope the application stops sending emails and no exception is thrown.

If (lp! = null)

{code}

Sleep (65000);

But it did not work for me.

////////

public void run() {}
While (! _stop) {}
Address one;
Store is Session.getDefaultInstance () .getStore ();.
Records file [] = store.list (Folder.SENT);
Folder sentfolder = files [0];
Message m = new Message (sentfolder);
SimpleDateFormat sdf;
              
try {}
LP LocationProvider = LocationProvider.getInstance (null);
If (lp! = null) {}
Location = lp.getLocation (60);
Coordinates of c = l.getQualifiedCoordinates (); get the GPS coordinates
                       
If (c! = null) {}
Lat string = Double.toString (c.getLatitude ()); Latitude
LNG chain = Double.toString (c.getLongitude ()); Longitude
String alt = Float.toString (c.getAltitude ()); altitude
Tim string = Long.toString (l.getTimestamp ()); timestamp
String spd = Float.toString (l.getSpeed ()); Speed
                           
String orgstr = "0449953853", + tim + ',' + lat + ',' lng + ',' + ', ' + alt;
String googmap =http://maps.google.com/maps?q= "+ lat + ',' + LNG;
String finalstr = orgstr + "\n" + googmap;
a = new address ("[email protected]", "Aditya Tuli";)
Address address [] = {a};
m.addRecipients (Message.RecipientType.TO, addresses);
m.setContent (finalstr);
m.setSubject ("GPS Position";)
Transport.Send (m);
}
} sleep (65000); moved to re - run the thread
} catch (Exception e) {}
System.Err.println ("an error occurred" + try ());
System.Exit (0);
}
}
}

///////

Please suggest.

Thanks in advance.

Concerning

I think we have agreed that the problem is that it is there no LocationProvider or the getLocation is not a place, so to determine which of them seems to be the best place to start.  As you test on the device, you must debug on the device, you can connect by USB, starting the JDE, using the Debug/Attach To / Pocket PC, then select USB connected device.

From there, you should be able to use the JDE debug, but according to levels, this sometimes does not work so well for me.  So I would like to add three statements of System.out.println (...), one at the beginning of the loop and the others inside each of the ' if.  This load on the device, then, once debugging started, simply wait for the missing output for each loop!

Who help me?

Tags: BlackBerry Developers

Similar Questions

  • Send a Blackberry smart phone info to a database on a server using Java?

    Hello

    I'm new to the Blackberry development... but I now have a project to do.

    I want to retrieve the latitude and longitude of Blackberry GPS and send them to a database on a server every 30 minutes.  Also, I want to be able to do without the user doing anything on his Blackberry (I mean, I don't want him to click somewhere every now and them).

    I was able to get the latitude and longitude (double) using Java.

    I don't know how to get out them of the BlackBerry.

    Can anyone help?

    Thank you

    BTW, I do my testing on a 8310 Rogers using JDE 4.2.1 Simulator.

    Hello

    The BlackBerry smart phone needs a 'gateway' to connect to the internet. This white paper is extremely useful to explain all your choices of selection of the good gateway:

    Data on BlackBerry 4 Wireless Transport Management - Part 1

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe?func=LL&objid=832210&objAction=browse&s...

    Once you have selected the gateway, then you can go ahead and use the Connector.open (url) command to create a HTTP connection to the application server (Tomcat, JBoss, .NET, etc.) on the internet. The application server could then use ODBC/JDBC to store data in the database.

    Tariq

  • BlackBerry Smartphones BlackBerry Pearl 8100 how to use Java Apps (.jad/.jar)

    OK, I have like 5 or more applications and games on my memory card Blackberry Pearl 8100 not not started then the difference of "Nokia" and when I try 2 install it using the desktop program thingie provided with Blackberry, where you can for example manage media and the program called application loader that is not Java applications how to Blackberry as he tells me he uses Java [If you go to 'options', 'about' [u would get some info, and it shows me the Java logo and that this device IS POWERED TESTED CONTAINING JAVA AND SUN MICRO SYSTEMS INC. JAVA VIRTUAL MACHINE COMPATIBLE SOFTWARE.] But I had no experience using Java on Blackberry what So Ever.

    Please help me and please don't tell me that it won't work, I just got this phone! ??

    Oh really dang can you atleas may explain wats the use of Java on the Blackberry please!

  • Can use code MNO to get Blackberry - GPS location if not available

    Can we use code MNO for location of the BlackBerry - GPS terminal if not available in this device?

    If yes then give me an idea how?

    If not, then is there any other way to get the approximate location of this device using mobile operator (if no GPS available)?

    Waiting for your answers...

    Thanx

    We can use the google hidden APIs to get the latitude and longitude, by the way

    GPRSInfo.getCellInfo () .getLAC)

    and GPRSInfo.getCellInfo () .getCellId)

    to this API.

    So resolute. Thnx

  • Send a mail using java in oracle 11 g

    I using database 11 g...

    I created a procedure to send a mail using java... as below

    [code]

    CREATE OR REPLACE AND COMPILE JAVA NAMED "SendAttach" AS SOURCES

    import java.util.Properties;

    Javax.mail import. *;

    Javax.mail.internet import. *;

    Javax.activation import. *;

    public class SendAttach {}

    Public Shared Sub sendmail (recipient String, object, String, String msg, String file)

    {

    String host = "smtp.gmail.com; »

    " the end user String = ' [email protected] '; change accordingly

    final String password = "psd"; changes accordingly

    String to = recipient; changes accordingly

    Properties props = new Properties ();

    props.put ("mail.smtp.host", "smtp.gmail.com");

    props.put ("mail.smtp.socketFactory.port", "465");

    props.put ("mail.smtp.socketFactory.class",

    "javax.net.ssl.SSLSocketFactory");

    props.put ("mail.smtp.auth", "true");

    props.put ("mail.smtp.port", "465");

    A session = Session.getDefaultInstance (accessories,

    new javax.mail.Authenticator () {}

    protected PasswordAuthentication getPasswordAuthentication() {}

    return new PasswordAuthentication (user, password);

    }

    });

    try {}

    MimeMessage message = new MimeMessage (session);

    message.setFrom (new InternetAddress (user));

    message.addRecipient (Message.RecipientType.TO, new InternetAddress (to));

    message.setSubject (subject);

    BodyPart messageBodyPart1 = new MimeBodyPart();  newly added

    messageBodyPart1.setText (msg);  newly added

    message.setText (msg);

    MimeBodyPart messageBodyPart = new MimeBodyPart();

    Several multipart part = new MimeMultipart();

    messageBodyPart = new MimeBodyPart();

    String file1 = file;

    String fileName = "sql";

    Data source source = new FileDataSource (file1);

    messageBodyPart.setDataHandler (new DataHandler (source));

    messageBodyPart.setFileName (fileName);

    multipart.addBodyPart (messageBodyPart);

    multipart.addBodyPart (messageBodyPart1);

    message.setContent (multipart);

    Transport.Send (message);

    System.out.println ("message sent successfully...");

    } catch (MessagingException e) {e.printStackTrace () ;}

    }

    }

    /

    It works finw with sysdba login.

    But it gives below error when I connected as user (ori) my username

    prs.png

    Help me to solve the problem...

    Thank you all for the response guys...

    Finally, I have soluion...

    Please follow these steps. If you want to do the same thing

    step 1: connect sysdba virtue

    step 2:grant the bottom of the permissions for the database

    • Call dbms_java.grant_permission ('ORI',
    • ("java.util.PropertyPermission ',' * ',"read, write");
    • run dbms_java.grant_permission('ORI','java.util.PropertyPermission','*','read').
    • run dbms_java.grant_permission ("ORI", 'SYS:java.lang.RuntimePermission', 'getClassLoader', ' ');
    • run dbms_java.grant_permission ("ORI", 'SYS:oracle.aurora.security.JServerPermission', 'Check', ' ');
    • run dbms_java.grant_permission ("ORI", 'SYS:java.lang.RuntimePermission', 'accessClassInPackage.sun.util.calendar', ' ');   run dbms_java.grant_permission ("ORI", 'java.net.SocketPermission', ' *', ' connect, solve ");
    • run dbms_java.grant_permission ("ORI", 'SYS:java.lang.RuntimePermission', 'createClassLoader', ' ');

    Note: replace ORI with your user_name DB

    Step 3: Download 2 jar files jaf - 1.1.1 and javamail - 1.1.1.jar oracle community network

    Step 4: Unzip these two files in sphecific folder.so you can find two jar files activation.jar and mail.jar

    step 5:now open the command prompt in the path where the files two jar are placed in and loading these two pots in DB using below command

    loadjava-user U_name/PSD - solve - synonym mail.jar

    loadjava-user U_name/PSD - solve - synonym activation.jar

    step 6:now run your java process

    [code]

    CREATE OR REPLACE AND COMPILE JAVA NAMED "SendAttach" AS SOURCES

    import java.util.Properties;

    Javax.mail import. *;

    Javax.mail.internet import. *;

    Javax.activation import. *;

    public class SendAttach {}

    Public Shared Sub sendmail (recipient String, object, String, String msg, String file)

    {

    String host = "smtp.gmail.com; »

    the final String user = "mail_id"; changes accordingly

    final String password = 'email_password '; changes accordingly

    String to = recipient; changes accordingly

    Retrieve the session object

    Properties props = new Properties ();

    props.put ("mail.smtp.host", "smtp.gmail.com");

    props.put ("mail.smtp.socketFactory.port", "465");

    props.put ("mail.smtp.socketFactory.class",

    "javax.net.ssl.SSLSocketFactory");

    props.put ("mail.smtp.auth", "true");

    props.put ("mail.smtp.port", "465");

    A session = Session.getDefaultInstance (accessories,

    new javax.mail.Authenticator () {}

    protected PasswordAuthentication getPasswordAuthentication() {}

    return new PasswordAuthentication (user, password);

    }

    });

    Compose the message

    try {}

    MimeMessage message = new MimeMessage (session);

    message.setFrom (new InternetAddress (user));

    message.addRecipient (Message.RecipientType.TO, new InternetAddress (to));

    message.setSubject (subject);

    BodyPart messageBodyPart1 = new MimeBodyPart();  newly added

    messageBodyPart1.setText (msg);  newly added

    message.setText (msg);

    MimeBodyPart messageBodyPart = new MimeBodyPart();

    Several multipart part = new MimeMultipart();

    messageBodyPart = new MimeBodyPart();

    String file1 = file;

    String fileName = "sql";

    Data source source = new FileDataSource (file1);

    messageBodyPart.setDataHandler (new DataHandler (source));

    messageBodyPart.setFileName (fileName);

    multipart.addBodyPart (messageBodyPart);

    multipart.addBodyPart (messageBodyPart1);

    message.setContent (multipart);

    Send the message

    Transport.sendMessage (message, to);

    Transport.Send (message);

    System.out.println ("message sent successfully...");

    } catch (MessagingException e) {e.printStackTrace () ;}

    }

    }

    /

    step 7:

    CREATE or REPLACE procedure NAME of JAVA LANGUAGE AS Send_Attach (container VARCHAR, subject VARCHAR, msg VARCHAR, leader VARCHAR) "SendAttach.sendmail (java.lang.String, java.lang.String, java.lang.String, java.lang.String);

    /

    step 8: say commit.

    step 9:

    Declare

    beneficiary varchar (50): = "recipient_id";

    subject varchar (100): = "Hello";

    MSG varchar (500): = 'this is a test mail with an attachment;

    varchar (100) file: = "path of the file";                   file path - weed

    Begin

    dbms_java.grant_permission('ORI','java.) IO. FilePermission ', leader,' read');

    Send_Attach (container, Subject, MSG, file);

    End;

    [\commit]

    Note: disable windows firewall and anti virus before phone emails

    keep smiling...

  • How to add a list of users of Blackberry Messenger using Java?

    Hi all

    Do I want to, a Midlet Application to add a list of users to BB Messenger PIN or email. Is it possible using the Blackberry API?

    If this is the case, could you please send me links or any other useful animals...

    or

    Is it possible to send contacts from this using BES BlackBerry BB Messenger?

    Thank you

    There is no API BlackBerry that allow you to add contacts to BlackBerry Messenger.

  • You say don't not to use Java, but when I remove it, I just can't see vedios and things don't work properly. So, if I cancel Java I use.i

    Explain to us whether to use Java. ? If she isent safe for our games and coupons and videos that which must be loaded on the computer to make these things work. ? Damed if we do and damed if we do not have. People who are not computer and get older, how do you know how. We need 1 2 3 4 steps. After I update you, I started getting pop ups, especially since a Web Guard, I tried to take off and fought with him for 1 1/2. My computer wouldn't work. I have Avast security and when these security companies we safe. And these cleaner companies, other things, try to take over the computer. If you pay or you pay not it's the same, everyone wants to take control of your computer. I don't have a TV, my computer is important to me. And then the computer when I try to enter read something special on an e-mail, it begins to roll said empty in the box and just keeps circling. Unfortunate I need free things to download to help me and then the things I try something underhanded coming on the tail and destroy my computer. Not in the position to hire Nerds to fix.

    The Java security problems is Java Deployment Toolkit.
    Not all Java programs.

    Java downloads for all operating systems

  • What address info iMessaging uses to communicate between devices?

    I wonder if anyone knows what info address is used (required) to transmit messages between Apple devices.  Is - this phone number or email address?  I have an iPad and exchanged messages with other iPads and also successfully iPhones.  iPads do not use telephone numbers (that I know) and iPhones need phone numbers and e-mail addresses to perform their multiple functionality.  Also, whence the iMessaging app get it is coordinated with and how does he know if a specific contact is able to use the function iMessaging?  Also, I have a contact who is an iPhone user and I can't send the contact a message successfully.  What would prevent that from happening?

    Let's see if I can hit all your questions.

    • iPads use e-mail addresses, iPhone uses the e-mail addresses and phone numbers.
    • If you have an iPhone and an iPad the iPad can use the phone number.
    • The iMessage application uses your contact app.
    • Apple maintains a database of iMessage of all devices that can use iMessage (this includes the iOS and OS X devices). When you send a message from your device queries this database.
    • Update of the Apple database when your turn on iMessage on your iPad. the iPad sends a message to the server. For iPhones, iMessage on the phone sends an SMS "invisible" to an Apple server to the United Kingdom for his phone number.
    • If there is an iPhone that you can not send to either the owner has not enabled iMessage, or that it doesn't clog you, accidentally or deliberately.
  • Can I use java for the development of the playbook?

    Hi I'm new in blackberry development. I've owned playbook and that you want to develop playbook apps, but I can only develop in java. Please, someone tell me what I can use java for the development of the Tablet?

    Bilal

    # You can convert by android android applications, run-time.

    Explore these links

    https://developer.BlackBerry.com/

    https://developer.BlackBerry.com/Java/

  • Application using Java SDK 5.0 compatible with the lower SDK version?

    Hello

    I wanted to know if I'm developing an application using the Blackberry Java SDK 5.0, it would work on slot version 4.3 or 4.2.1? If the current application has features not available on the previous version of course.

    I mean, if I develop an application of basic as a HelloWorld with SDK 5.0, this app works on a phone with SDK 4.2.1?

    Thank you

    Damien.

    The only time where I tried it, I received an error of compatilbility so I would say not in my experience.

    My suggestion is to build with backward compatibility in mind and remember that what you build for 4.2 will work in 5.0 and so on.

  • Breakpoints at a standstill using Java/Eclipse/9000

    Hello

    I am new to Java, please bear with me if this is a silly question.  Earlier today, I was running very well the breakpoints and dandy using the Simulator.  Subsequently each time that the code hits a breakpoint when I step over it sits there for centuries and finally (apparently) falls where dispatcher.

    (If I don't put a breakpoint in the code load and works very well - it also doesn't seem to matter where I put the breakpoint)

    Is this a known problem, or has someone met before and found a way to fix it?

    Thank you very much

    Dave

    Thanks for your reply Mark.  I ended up changing to Eclipse to use Blackberry JDE and everything works again.

    I haven't used Java well before doing so the passage makes little difference to me.

    Van

    Dave

  • Creation of posts of Siebel using JAVA API in IOM

    Hi Experts,

    I need to create positions of Siebel using JAVA API.

    I try to incorporate OIM 11 g-Siebel connector, but this connector is not able to create new positions of siebel.

    Please tell me where to find the info/examples of use of the api or how to best integrate?

    Thanks in advance

    Kiran

    This is useful.

    I was able to create a post of siebel using the model given here,

    Creating New position in Siebel using Siebel DataBean

  • I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I downloaded Safari 10 and now every page that uses Java asks me to activate or not. How to avoid this new feature? I have problems to access my bank account.

    I think they mean JavaScript.

    In your Safari menu bar, click Safari > Preferences and then select the Security tab, and then select: Enable JavaScript

  • Run the jar using Java 7?

    My Macbook Pro currently runs on Java 8, and I want to start a specific jar (minecraft associated) that supports only Java 7, is there a way I can run the file using Java 7 through terminal. I can share the script starting current I use here - http://pastebin.com/XEq01mdZ - the jar file is called cauldron.jar.

    Thank you for your help.

    I don't have any Java installed for an exact string to show you, but each version of Java is installed in its own folder. You can call this version of Java by specifying the full path to the particular version.

    The java_home command will show you what JVM you have installed with the path to each House.

  • Can what free e-mail program I use to create an e-mail address to reserve for use with a Mozilla browser?

    Hello

    Since it took over an hour to send an email from my gmail address, the other andsince of night I tried without success to create an address @outlook.com in Internet Explorer 8, I would use Mozilla to create a free reserve email address. Is it possible to do in Mozilla instead of using Google Chrome or Internet Explorer 8? Thank you for helping a dummie real when it comes to create an email address of reserve.

    Kind regards
    Edwin

    To display the toolbar of bookmarks in the toolbar box, you can use one of these menus:

    • Right click on an empty area of the tab bar
    • Press the Alt key > menu view > toolbars

    It is a shortcut to Yahoo mail, you can use this URL:

    https://mail.Yahoo.com/

    It is a shortcut for Gmail, you can use this URL:

    https://www.gmail.com/

    You can add those toolbar bookmarks by dragging the link and by the applicant on the toolbar. To shorten the name, right click on the bookmark, and then select Properties. Then change the name (not location).

    More information on bookmarks in Firefox:

    About Thunderbird, if you have ever used, I think that you can go ahead and remove it.

Maybe you are looking for

  • You can buy a gift card to iTunes without a credit card?

    I am trying to send a gift card to iTunes by e-mail, but when I try to purchase it will be my payment information. It doesn't let me go forward until what I put my credit card details in. Is it possible to use the money I have on my account of iTunes

  • No network after controller updated windows system 8

    I refreshed my cause stupid windows 8 I had strange things pop - up on the screen, so I refreshed the system. Now I can't connect to Internet and miss me all my emails, contacts, Favorites, photos and else who knows what. I want answers to everything

  • Report writing file spreadsheet using Excel

    I did up a VI that writes all my 7 entries and column headers to a file of Excel csv for my report. However, most of the data values and the column headers from my Excel file is all packed together in 1 cell. How each value and header occupy only 1 c

  • My drive

    My fable one disc had stolen is there a way I could get a replacement.

  • Movie offer, before their download queue time

    The waiting time for movies free offer to download