<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=Java2MicroEdition%2FMidpHttpConnectionExample</id>
	<title>Java2MicroEdition/MidpHttpConnectionExample - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.zeropage.org/index.php?action=history&amp;feed=atom&amp;title=Java2MicroEdition%2FMidpHttpConnectionExample"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Java2MicroEdition/MidpHttpConnectionExample&amp;action=history"/>
	<updated>2026-05-15T21:05:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=Java2MicroEdition/MidpHttpConnectionExample&amp;diff=87480&amp;oldid=prev</id>
		<title>Maintenance script: Repair MoniWiki formatting after migration</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Java2MicroEdition/MidpHttpConnectionExample&amp;diff=87480&amp;oldid=prev"/>
		<updated>2026-03-29T00:34:23Z</updated>

		<summary type="html">&lt;p&gt;Repair MoniWiki formatting after migration&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:34, 29 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l114&quot;&gt;Line 114:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 114:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Java2MicroEdition&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;Java2MicroEdition&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=Java2MicroEdition/MidpHttpConnectionExample&amp;diff=84511&amp;oldid=prev</id>
		<title>Maintenance script: Repair batch-0002 pages from live compare</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Java2MicroEdition/MidpHttpConnectionExample&amp;diff=84511&amp;oldid=prev"/>
		<updated>2026-03-27T00:16:05Z</updated>

		<summary type="html">&lt;p&gt;Repair batch-0002 pages from live compare&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:16, 27 March 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l103&quot;&gt;Line 103:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 103:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          String ret = null;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          String ret = null;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          try {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;          try {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              byte buffer&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[] &lt;/del&gt;= new byte&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/del&gt;10&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              byte buffer&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#91;&amp;amp;#93; &lt;/ins&gt;= new byte&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#91;&lt;/ins&gt;10&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;#93;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              dis.read(buffer);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              dis.read(buffer);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              ret = new String(buffer);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              ret = new String(buffer);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l115&quot;&gt;Line 115:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 115:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Java2MicroEdition&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Java2MicroEdition&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
	<entry>
		<id>https://mediawiki.zeropage.org/index.php?title=Java2MicroEdition/MidpHttpConnectionExample&amp;diff=32934&amp;oldid=prev</id>
		<title>imported&gt;Unknown at 05:23, 7 February 2021</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.zeropage.org/index.php?title=Java2MicroEdition/MidpHttpConnectionExample&amp;diff=32934&amp;oldid=prev"/>
		<updated>2021-02-07T05:23:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Spike2.java ===&lt;br /&gt;
 package com.minnysunny.mobilerssreader.spike;&lt;br /&gt;
 &lt;br /&gt;
 import javax.microedition.midlet.*;&lt;br /&gt;
 import javax.microedition.io.HttpConnection;&lt;br /&gt;
 import javax.microedition.lcdui.*;&lt;br /&gt;
 &lt;br /&gt;
 public class Spike2 extends MIDlet implements CommandListener {&lt;br /&gt;
     private Display display;&lt;br /&gt;
     private TextBox tb;&lt;br /&gt;
     private Command exit;&lt;br /&gt;
     private HttpConnection httpConn;&lt;br /&gt;
     &lt;br /&gt;
     public Spike2() {&lt;br /&gt;
         SpikeGetHtml sgh = new SpikeGetHtml(&amp;quot;http://dduk.idaizy.com/j2me/test.txt&amp;quot;);&lt;br /&gt;
         String str = sgh.getContent2();&lt;br /&gt;
         sgh.cleanUp();&lt;br /&gt;
         &lt;br /&gt;
         display = Display.getDisplay(this);&lt;br /&gt;
         exit = new Command(&amp;quot;EXIT&amp;quot;, Command.EXIT, 0);&lt;br /&gt;
         //tb = new TextBox(&amp;quot;Example&amp;quot;, &amp;quot;HelloWorld&amp;quot;, 20, TextField.ANY);&lt;br /&gt;
         tb = new TextBox(&amp;quot;Example&amp;quot;, str, 20, TextField.ANY);&lt;br /&gt;
         tb.addCommand(exit);&lt;br /&gt;
         tb.setCommandListener(this);&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     protected void startApp() throws MIDletStateChangeException {&lt;br /&gt;
         display.setCurrent(tb);&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     protected void pauseApp() {&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     protected void destroyApp(boolean b) {&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     public void commandAction(Command c, Displayable d) {&lt;br /&gt;
         if( c == exit ) {&lt;br /&gt;
             destroyApp(false);&lt;br /&gt;
             notifyDestroyed();&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
  &lt;br /&gt;
=== SpikeGetHtml.java ===&lt;br /&gt;
 &lt;br /&gt;
 package com.minnysunny.mobilerssreader.spike;&lt;br /&gt;
 &lt;br /&gt;
 import java.io.DataInputStream;&lt;br /&gt;
 import java.io.IOException;&lt;br /&gt;
 &lt;br /&gt;
 import javax.microedition.io.Connector;&lt;br /&gt;
 import javax.microedition.io.HttpConnection;&lt;br /&gt;
 &lt;br /&gt;
 public class SpikeGetHtml {&lt;br /&gt;
     private HttpConnection httpConn;&lt;br /&gt;
     private DataInputStream dis;&lt;br /&gt;
     &lt;br /&gt;
     public SpikeGetHtml(String url) {&lt;br /&gt;
         try {&lt;br /&gt;
             init(url);&lt;br /&gt;
         } catch(IOException ex) {&lt;br /&gt;
             ex.printStackTrace();&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     private void init(String url) throws IOException {&lt;br /&gt;
         httpConn = (HttpConnection)Connector.open(url);&lt;br /&gt;
         httpConn.setRequestMethod(HttpConnection.GET);&lt;br /&gt;
         httpConn.setRequestProperty(&amp;quot;User-Agent&amp;quot;, &amp;quot;Mozilla/4.0&amp;quot;);&lt;br /&gt;
         dis = httpConn.openDataInputStream();&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     public void cleanUp() {&lt;br /&gt;
         try { &lt;br /&gt;
 	        if( dis != null ) {&lt;br /&gt;
 	            dis.close();&lt;br /&gt;
 	            dis = null;&lt;br /&gt;
 	        }&lt;br /&gt;
 	        if( httpConn != null ) {&lt;br /&gt;
 	            httpConn.close();&lt;br /&gt;
 	            httpConn = null;&lt;br /&gt;
 	        }&lt;br /&gt;
         } catch(IOException ex) {&lt;br /&gt;
             ex.printStackTrace();&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     public String getContent() {&lt;br /&gt;
         String ret = &amp;quot;&amp;quot;;&lt;br /&gt;
         try {&lt;br /&gt;
             for(int i=0; i&amp;amp;lt;4; ++i) {&lt;br /&gt;
                 byte b = dis.readByte();&lt;br /&gt;
                 ret += (char)b;&lt;br /&gt;
             }&lt;br /&gt;
         } catch(IOException ex) {&lt;br /&gt;
             ex.printStackTrace();&lt;br /&gt;
         }&lt;br /&gt;
         return ret;&lt;br /&gt;
     }&lt;br /&gt;
     &lt;br /&gt;
     public String getContent2() {&lt;br /&gt;
         String ret = null;&lt;br /&gt;
         try {&lt;br /&gt;
             byte buffer[] = new byte[10];&lt;br /&gt;
             dis.read(buffer);&lt;br /&gt;
             ret = new String(buffer);&lt;br /&gt;
         } catch(IOException ex) {&lt;br /&gt;
             ex.printStackTrace();&lt;br /&gt;
         }&lt;br /&gt;
         return ret;&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
  &lt;br /&gt;
----&lt;br /&gt;
Java2MicroEdition&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>