×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,557

    Re: Can we open a textfile and write some data in J2me

    How to create a text file (or any file) in J2ME and how to write to it, and how to open an existing file, seek to position (such as th end) and write more to it, is documented in the SDK where the FileConnection API is documented. I propose you read and study it.

    Finding the available root file systems, etc., is also documented, for example, in the article I just posted previously. I suggest you study it, too, as well as the other FileConnection articles and examples in the wiki. It is really quite a straight-forward API. Just remember, that you're not allowed to create files anywhere you like (and where you are allowed varies by the target device/platform).

  2. #17
    Registered User
    Join Date
    Jul 2012
    Location
    South America
    Posts
    43

    Re: Can we open a textfile and write some data in J2me

    hello sir good day !!

    this is my new problem about Encryption in data .


    I'm using j2me then my data that will send in our server is encrypted but the problem is my program is j2me then the receiver is php. my question sir
    is there any code on how to decrypt a data or a message from j2me then it will received by php ?

    how it works is this possible sir ??
    can you please advice me or to suggest something .
    or can you please give me some codes for this.



    Thank you and god Bless !! )
    Have A nice Day .

  3. #18
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,557

    Re: Can we open a textfile and write some data in J2me

    You can use HTTPS (SSL) requests to encrypt the data more or less transparently/automagically.

    Otherwise, you can use the same encryption/decryption algorithm and keys on both ends. E.g., Bouncy Castle: http://www.bouncycastle.org/

  4. #19
    Registered User
    Join Date
    Jul 2012
    Location
    South America
    Posts
    43

    Re: Can we open a textfile and write some data in J2me

    Sir good day !!

    This is my question sir ,,
    Sir im not using php im a java programmer ..

    We have 2 server and a phone

    The network server and the Real server

    SERVER 1 - is the network server.
    SERVER 2 - is the real server/Receiver of the data . the program used here is PHP ..
    PHONE - it is the sender.. the program used here is a codes in j2me

    This is the flow of the program .

    The cellphone will send a message to the second server then all messages will go to the first server and sent out on secondary server. This message will be encrypted with codes of J2ME so that the first server and the second server is disturbed, so they can read the message properly . Sir is there any codes for the server 2 (PHP) to decrypt the message from the phone using j2me..

    Sir thank you !!

    God Bless ..
    PLEASE HELP ME ..

    have a nice day !!

  5. #20
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,557

    Re: Can we open a textfile and write some data in J2me

    No special programming at all is required (on either end, really), if you decide to leave the encryption/decryption to the HTTP stack (i.e., use HTTPS, instead of HTTP).

  6. #21
    Registered User
    Join Date
    Jul 2012
    Location
    South America
    Posts
    43

    Re: Can we open a textfile and write some data in J2me

    sir so it is possible that the messages from the phone that was encrypted in j2me it can decrypt by using php codes?
    sir so it is possible? so sir where is the codes can you please help me and give me some codes on it .?

  7. #22
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,557

    Re: Can we open a textfile and write some data in J2me

    Quote Originally Posted by AnorEnaj2330 View Post
    sir so it is possible that the messages from the phone that was encrypted in j2me it can decrypt by using php codes?
    sir so it is possible? so sir where is the codes can you please help me and give me some codes on it .?
    If you use HTTPS/SSL it is done automatically (the J2ME app deals with clear data, and the underlying system software encrypts it for you automatically, and on the other end, the web server and the HTTP/HTTPS software on that side will decrypt it for you automatically and the PHP only needs to deal with clear data):

    Basic indo on the subject (what HTTPS is): http://en.wikipedia.org/wiki/HTTPS

    Example in the wiki (which you have been pointed to already at least three times in this thread alone): http://www.developer.nokia.com/Commu...tps_in_Java_ME



    Otherwise, if you do it (encrypting/decrypting) in code yourself, then you *MUST* have both the J2ME code *AND* the PHP code written to use the *SAME* encryption/decryption algorithms *AND* the same keys (regardless of whether you decide to use symmetric or asymmetric encryption, and which algorithm you choose).

  8. #23
    Registered User
    Join Date
    Jul 2012
    Location
    South America
    Posts
    43

    Re: Can we open a textfile and write some data in J2me

    sir but in encryption im using j2me then in decryption is php ?
    how can i do that ??

    where should I mix the codes in j2me or in php.

    sir i need your help .
    thanks in regard .

  9. #24
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,557

    Re: Can we open a textfile and write some data in J2me

    You write (implement) or find the J2ME version of the encryption algroithm (Java programming language) and use that on the phone, and then you implement or find the *SAME* encryption algorithm using the PHP programming language for the server side. Two versions of the code, where one version runs on the phone, and the other on the server.

    Of course, instead of PHP, you could also Java on the server side, too, or some other programming language.

    In any case, you have to be able to develop software for *BOTH* the phone *AND* the server, as they don't run the same software (but different software that can do the same thing; encrypt/decrypt).

    Or, as this seems to be difficult for you, don't write any encryption/decryption code at all, but *USE* HTTPS (the code has already been written an exists both on your phone and server, and all you need to do is to make HTTPS requests instead of HTTP requests).

  10. #25
    Registered User
    Join Date
    Jul 2012
    Location
    South America
    Posts
    43

    Re: Can we open a textfile and write some data in J2me

    sir all i want is the code for decrypting in program ..
    our server is a database made of php program .
    ang i have my codes in encrypting in j2me
    then i need is decrypting in php

    thats why how it works..


    sir i dont need a https .
    thanks in regard .

  11. #26
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,557

    Re: Can we open a textfile and write some data in J2me

    In that case, I repeat, *WRITE* or *FIND* an implementation of *ANY* encryption code, for which you *ALSO* write or find a *CORRESPONDING* (same algorithm/technique) PHP implementation. If you do not have the *SAME* (corresponding) encryption/decryption algorighm in use on *BOTH* ends, it will not work (the other party speaks Chinese, and the other Egyptian and they don't know what each one is saying; a bit like how I feel here, even if we both appear to be writing in English).

    This is *NOT* a PHP forum for finding PHP code and help with PHP programs. For that, try, e.g., http://www.php.net/support.php (but when you do, remember that you need find code for the *SAME* encryption algorithm/techinque that you use in the J2ME program).




    Edit (a bit more for you, in case you don't find it on your own):

    Here's PHP documentation on encryption/decryption functions supported in PHP: http://php.net/manual/en/ref.mcrypt.php

    Here's a list of "ciphers" (encryption/decryption algorithms/techniques) supported by PHP: http://php.net/manual/en/mcrypt.ciphers.php

    Now, go find a J2ME version of those "ciphers": http://www.google.com


    P.S. Using HTTPS would still be easier for your level of expertise.
    Last edited by petrib; 2012-09-28 at 08:12.

  12. #27
    Registered User
    Join Date
    Jul 2012
    Location
    South America
    Posts
    43

    Re: Can we open a textfile and write some data in J2me

    sir good day .. thanks for that links ..
    i do not really understand because im not a php developer
    sir is there any code for universal for data decrypter.??


    sir i need a codes sir do you want to see the flow of the program i hav emy pic here ..

    sir i need a codes for me to pass it to my professor ..

    just on how to decrypt my message in database then it is php,.

    sir is there universal codes for me to decrypt the data.


    thanks in regard.

Similar Threads

  1. Replies: 1
    Last Post: 2009-06-01, 11:36
  2. Replies: 8
    Last Post: 2008-02-29, 12:32
  3. can we like sync operation in j2me with data cables?
    By premlathiya in forum Mobile Java General
    Replies: 4
    Last Post: 2006-09-07, 18:00
  4. can we write j2me application(using midp1.0) that blocks the calls
    By Rameshwari in forum Mobile Java General
    Replies: 2
    Last Post: 2006-06-08, 13:32
  5. How can I write an array into a textfile?
    By manu.20 in forum Symbian
    Replies: 1
    Last Post: 2005-05-25, 14:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×