<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://www.mobile-j.de/snipsnap/rdf'>
    <s:Snip rdf:about='http://www.mobile-j.de/snipsnap/rdf#J2ME/Reading+files+from+J2ME+on+a+6600'
         s:cUser='bjoernQ'
         s:oUser='bjoernQ'
         s:mUser='bjoernQ'>
        <s:name>J2ME/Reading files from J2ME on a 6600</s:name>
        <s:content>1 Not possible?&#xD;&#xA;Well it&apos;s not that easy. But it can be done.\\&#xD;&#xA;First of all we need everybody&apos;s darling - {link:FExplorer|http://users.skynet.be/domi/fexplorer.htm}.\\&#xD;&#xA;&#xD;&#xA;Playing around with it we will find the midp20.exe. Beaming this via bluetooth to the PC and looking at it with an hex-editor ... and we will find something like &quot;com.symbian.midp.runtime.NativeFile&quot;. Wonder what this class could do ... \\&#xD;&#xA;&#xD;&#xA;Well there&apos;s a &quot;open(String s)&quot; and an &quot;getBytes(byte[] buffer, int len)&quot; and certainly a &quot;close()&quot;. Cool.&#xD;&#xA;&#xD;&#xA;Unfortunately these methods are not accessible from outside the package &quot;com.symbian.midp.runtime&quot;. And if you try to add a class in that package to your jar file will result in a midlet that won&apos;t be installable.\\&#xD;&#xA;&#xD;&#xA;But wait. You can create a dummy midlet. Install it and then change your code to include a Class that can call the wanted methods of NativeFile. \\&#xD;&#xA;\\&#xD;&#xA;e.g.\\&#xD;&#xA;{code}&#xD;&#xA;package com.symbian.midp.runtime;&#xD;&#xA;&#xD;&#xA;public class HackTest {&#xD;&#xA;    &#xD;&#xA;    &#xD;&#xA;    public static String testIt() throws Exception{&#xD;&#xA;        NativeFile nf = new NativeFile();&#xD;&#xA;        nf.open(&quot;c:\\SmallFile&quot;);&#xD;&#xA;        byte[] buffer = new byte[512];&#xD;&#xA;        int l = nf.getBytes(buffer,512);&#xD;&#xA;        nf.close();&#xD;&#xA;        StringBuffer sb = new StringBuffer();&#xD;&#xA;        for(int i=0;i&lt;l;i++){&#xD;&#xA;            sb.append( (char)(buffer[i]));&#xD;&#xA;        }&#xD;&#xA;        &#xD;&#xA;        return sb.toString();&#xD;&#xA;        &#xD;&#xA;    }&#xD;&#xA;    &#xD;&#xA;}&#xD;&#xA;&#xD;&#xA;{code}&#xD;&#xA;(To compile the that class you will need the &quot;kmidp20.zip&quot; from the Nokia Series_60_MIDP_SDK_2_1 (I guess an other version will do also) in your classpath.)&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Now transfer the resulting jar-file but don&apos;t install it! Locate the installed midlet (e.g. &quot;E:\\\System\\\MIDlets\\\\[12345678\]\\\&quot; and overwrite the contained jar with the newly created one.\\&#xD;&#xA;Now launch the midlet and .... we&apos;re done. We can read a file from J2ME.&#xD;&#xA;&#xD;&#xA;\\&#xD;&#xA;1 Conclusion&#xD;&#xA;We can read a well known file. We have to tinker around with FExplorer since this hack cannot be installed easily. This method is not end-user friendly. But it&apos;s also not a security risk since the AMS hinders those midlets from being installed. \\&#xD;&#xA;Unfortunately I haven&apos;t figured out a way to list files in a directory or write to a file. But it&apos;s more something like a proof of concept.&#xD;&#xA;\\&#xD;&#xA;In the future we will have the PIM and File API in J2ME which makes something like this obsolete. (Although the access will be limited to files in some safe directories like &quot;pictures&quot; and &quot;sound files&quot;).&#xD;&#xA;&#xD;&#xA;</s:content>
        <s:mTime>2005-09-03 09:38:32.641</s:mTime>
        <s:cTime>2004-12-20 13:36:54.075</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#J2ME'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Sending SMS from MIDlet without user intervention'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Putting together BlueCove and avetanaOBEX'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Getting content from a MIDlet into the phone'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Getting the IMEI or not ...'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/How to verify the phone&apos;s MSISDN'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Fun with sending mms from a midlet'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#Products/GETrack'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Sending blinking sms to older Nokias ...'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Guessing the network operator'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Start Real One Player from J2ME'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Self signed midlets for the lazy bones'/>
                <rdf:li rdf:resource='#bjoernQ'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#PYTHON/Distributing Python apps'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2004-12-20/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#Fun/Send PC screen to SU2'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/System.out redirect on S60 3rd Edition'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/jCIFS port for JME'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#Products/S60 Screensaver Maker Pro'/>
                <rdf:li>
                    <s:Snip rdf:about='http://www.mobile-j.de/snipsnap/rdf#J2ME/Reading+files+from+J2ME+on+a+6600'>
                        <s:attachments
                             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
                    </s:Snip>
                </rdf:li>
                <rdf:li rdf:resource='#adsense'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2005-05-17/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2007-04-30/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Using the N95 accelerometer in Java - kind of'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#Fun/Send captured images from phone to SU2'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2006-08-20/1'/>
                <rdf:li rdf:resource='#Products'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#SnipSnap/config'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2006-08-01/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#Fun/Some MIDlets'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2006-02-28/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/MovingBall example ported to JME'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Reading files from J2ME on a 6600/'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2005-07-05/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2006-04-04/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2004-11-05/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#j2me/start+real+one+player+from+j2me'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#Products/POIXpress'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2005-08-01/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#start/2006-07-25/1'/>
                <rdf:li rdf:resource='http://www.mobile-j.de/snipsnap/rdf#J2ME/Sending+SMS+from+MIDlet+without+user+intervention'/>
                <rdf:li rdf:resource='#Links'/>
            </rdf:Bag>
        </s:snipLinks>
    </s:Snip>
</rdf:RDF>

