×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Angry Connecting J2ME application to Internet using WAP access point?

    Hi,

    I have a midlet which uses internet connection. When my midlet tries to connect to internet, it gives the options to select access point. If I choose WAP access point, it tries to connect for a long time and hangs there. But if I choose internet access point, it works perfectly.

    My question is that how to use MIDLET to use WAP access point for internet connection.

    Is it possible to use default accesspoint to connect from the midlet without giving the option to select access point?
    Regards,
    shagor

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    33

    Re: Connecting J2ME application to Internet using WAP access point?

    Please note that I've also posted same problem 3-4 lines under yours:
    http://discussion.forum.nokia.com/fo...ad.php?t=87136

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Unhappy Re: Connecting J2ME application to Internet using WAP access point?

    Hi thecloud,

    Thanks for your reply. I have read your discussion.

    So could you just tell me whether it is possible to connect to the internet from MIDLET via WAP access point not Internet access point.
    Regards,
    shagor

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Unhappy Re: Connecting J2ME application to Internet using WAP access point?

    Hi,

    I have just made a simple program to download some text. I can only use any Internet access point. If I use WAP access, it does not work. I would really appreciate if anybody knows how to use WAP access point in MIDLET.

    The source code is given below:

    Code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    
    public class NetDemo extends MIDlet
    {
    	private Display display;
    	private String url = "http://www.javacourses.com/hello.txt";
    
    	public NetDemo()
    	{
    		display = Display.getDisplay(this);
    	}
    
    	/**
    	 * This will be invoked when we activate the MIDlet.
    	 */
    	public void startApp()
    	{
    		// Use the specified URL is overriden in the descriptor
    		try
    		{
    		   downloadPage(url);
    		}
    		catch(IOException e)
    		{
    		   // handle the exception
    		}
    	}
    
    	private void downloadPage(String url) throws IOException
    	{
    		StringBuffer b = new StringBuffer();
    		InputStream is = null;
    		HttpConnection c = null;
    		TextBox t = null;
    
    		try
    		{
    			long len = 0 ;
    			int ch = 0;
    			c = (HttpConnection)Connector.open(url);
    			c.setRequestProperty( "User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0" );
    			is = c.openInputStream();
    
    			len =c.getLength() ;
    
    			if ( len != -1)
    			{
    			// Read exactly Content-Length bytes
    				for (int i =0 ; i < len ; i++ )
    				{
    					if ((ch = is.read()) != -1)
    					{
    						b.append((char) ch);
    					}
    				}
    			}
    			else
    			{
    				// Read till the connection is closed.
    				while ((ch = is.read()) != -1)
    				{
    					len = is.available() ;
    					b.append((char)ch);
    				}
    			}
    
    			t = new TextBox("hello again....", b.toString(), 1024, 0);
    
    		}
    		finally
    		{
    		   is.close();
    		   c.close();
    		}
    
    		display.setCurrent(t);
    	}
    
    	/**
    	 * Pause, discontinue....
    	 */
    	public void pauseApp()
    	{
    	}
    
    	/**
    	 * Destroy must cleanup everything.
    	 */
    	public void destroyApp(boolean unconditional)
    	{
    	}
    }
    Regards,
    shagor

  5. #5
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: Connecting J2ME application to Internet using WAP access point?

    hi shagor,

    #1
    first of all your sample wont' work on most devices due to starting io operation in the same thread as UserInterface thread (it wont start in Sun WTK if I'm correct at all),
    run sample from the other thread mentioned - that is that ones that ships e.g. with Sun WTK installation,

    #2
    it could really be either issue with:
    - your device (phone) - i've read a lot of similiar topics on sun support forums when searching for "midp/wap connections" topics (most of them were pointing to nokia support forums because most devices was older nokia devices and people had issue with using wap gateways for http tcp/ip connections),
    - your operator (service provider) settings for access points,
    if you can grab another device, ask a friend to lend you a one for tests and try with that other device,

    I personally do not have any issue running midp application via WAP-GRPS access point of my service provide (operator) on S60 device - as noted in other thread that should be transparent for standard HTTP TCP/IP connections to use waps gateways according to MIPD 2.0 - at least that is what I've read,

    regards,
    Peter

  6. #6
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Unhappy Re: Connecting J2ME application to Internet using WAP access point?

    Hi peterblazejewicz,

    Thanks for your reply. Yes I know that net connection has to be handled in different thread. It is just test application by quick hack. But that's not the issue here. It works on device with Internet access point. And it works with NokiaN70 WAP access point. I tested this app. with Nokia7610, Nokia6600, Nokia6670 with different operators. None of their WAP access point is working.

    So do you think, all of my operator do not allow WAP connection from MIDLET? Is there something to do with operator in this case? On which device, have you got WAP and MIDLET working? This is very surprising that you never had problem with WAP and MIDLET.
    Regards,
    shagor

  7. #7
    Registered User
    Join Date
    Jan 2007
    Posts
    1

    Re: Connecting J2ME application to Internet using WAP access point?

    then how can we get http content through wap gateway using midlet :S?????

  8. #8
    Registered User
    Join Date
    Jul 2008
    Posts
    11

    Re: Connecting J2ME application to Internet using WAP access point?

    Hello everybody,
    I want to read a pre-written URL in RFID tag and want to open that URL as soon as NFC enabled any handset is brought close to that Tag.
    The site I want to launch have text fields and images. I have problem to visualize the items available on the site while viewing in the browser of my handset. How to solve this problem so that textfields and images may appear in attractive format.
    Direly in need of help. Can someone share code.
    thanx
    Last edited by xahoor; 2008-08-18 at 12:53.

  9. #9
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    220

    Re: Connecting J2ME application to Internet using WAP access point?

    Hi All,

    AFAIK In the s40 3rd editions onwards phone of Nokia MIDlets are not abt to establish the HttpConnection using WAP access point. The reason for the same is that the handset is not able to recognize the proxy IP: port of the WAP gateway from the WAP settings given by operators.

    Regards
    Amit

  10. #10
    Registered User
    Join Date
    Apr 2009
    Posts
    1

    Re: Connecting J2ME application to Internet using WAP access point?

    J2ME HttpConnection issue when testing with Digi telco and Sony Ericsson W810i

    I am wondering why Lwuit-Makeover is able to connect but my own application can not. Then i found out that my application need to run in Internet setting but Lwuit-Makeover just need WAP setting.

    If request connection setting from telco, they will send you the following setting.

    Digi Streaming
    Digi Internet
    Digi MMS
    Digi WAP
    My personal experience about requesting the Digi internet setting. I had make more than 10 times to request Digi Internet setting. First few time failed was because of the "data account full...". Then i browsed to data comm.->data account to delete all the settings. After that, finally i can install successfully with those settings BUT there was no internet setting... So I kept on calling them to send me the internet setting. After few times request i met a guy who suggested to send only internet setting and not like previously send all settings(MMS,WAP,STREAMING, INTERNET...) in once. It work!!! Thanks guy.

    Lwuit-Makeover

    "Setting for java" can be WAP setting.
    Internally this application use com.sun.me.web.request api and Get method to make connection.

    My own application

    "Setting for java" does not work with WAP setting. It need internet setting.
    I use (HttpConnection) Connector.open("http://.."); and writebyte method to make connection.
    Is it mean that WAP only work for GET and internet setting is able to work with writebyte? I still need time to figure out what so special in com.sun.me.web.request.




    http://j6framework.blogspot.com/2010...ion-issue.html

  11. #11
    Registered User
    Join Date
    Oct 2009
    Posts
    10

    Re: Connecting J2ME application to Internet using WAP access point?

    Hi,

    Each time we make a WAP based connection the request go through the OPERATOR gateway which block other protocol such as HTTPConnetion ,SockectConnetion,ect...but when u r using Mobile Connect for("Airtel)it allows net connection.

  12. #12
    Registered User
    Join Date
    Jan 2009
    Location
    Mumbai
    Posts
    6

    Re: Connecting J2ME application to Internet using WAP access point?

    Hello All,

    It’s a good discussion about WAP and internet access point.

    I have also some query about internet access point.

    I also develop one j2me application and used http connection through internet access point.

    But when I used that, few mobiles required APN settings on that mobile.

    When we add APN setting with respective service provider then application is working fine otherwise connection not established from application and servers.

    If any one know about that please share.

    Thanks.
    Ashish
    Thanks & Regards!
    Ashish Kanate

  13. #13
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,563

    Re: Connecting J2ME application to Internet using WAP access point?

    Every phone needs to have:

    1) A data plan/subscription that allows the phone to send/receive packet data.

    2) An APN configuration, through which the traffic goes via the operator's (carrier's) network.

    3) For HTTP requests, the APN in use must be one where the operator passes through the HTTP protocol (might be a GPRS/Internet APN, or a WAP APN, but there may be restrictions with WAP APNs depending on the operator).

    4) The app must be connecting through that APN (or the phone must be configured so that all Internet traffic goes through that APN).

    If those conditions are not met, there's no way for any connections to happen from J2ME MIDlets, or otherwise. No working APN = no connections. If the APN works for some other app, e.g., the web browser in the phone, then the same APN should work also for your or anyone's MIDlets, too.

Similar Threads

  1. Wap link in J2ME application ??
    By papaddy in forum Mobile Java General
    Replies: 2
    Last Post: 2006-10-09, 15:59
  2. WAP Push in J2ME client/server Application
    By shaswata_jash in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2005-03-07, 10:25
  3. WAP Push in J2ME client/server Application
    By shaswata_jash in forum Mobile Java General
    Replies: 0
    Last Post: 2005-03-07, 10:18
  4. IrDA access through J2ME application
    By in forum Bluetooth Technology
    Replies: 0
    Last Post: 2002-04-13, 02:18

Posting Permissions

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