开发者

socket connection in j2me using GPRS

开发者 https://www.devze.com 2023-04-06 16:05 出处:网络
I am trying to open a socket connection in j2m2 on Nokia C5 device using my Airtel GPRS connection. I am using following lines of code.

I am trying to open a socket connection in j2m2 on Nokia C5 device using my Airtel GPRS connection. I am using following lines of code.

SocketConn开发者_高级运维ection connection=(SocketConnection)Connector.open("socket://www.cse.iitd.ernet.in:80");

It stucks here and never proceeds, no error is shown and no timeout.

I am able to open http connection using following code on the same device

HttpConnection connection=(HttpConnection)Connector.open("http://www.cse.iitd.ernet.in:80");

If some one could please help me out in this.


Are you sure no exception is thrown? Many (most) J2ME handsets block socket connections to port 80 for some reason - I don't really understand why to be honest. But if that were happening I would expect a SecurityException.

If you have control of the server, I suggest setting it up for some other port instead.


FOR NOKIAS IT WAS PRETTY SIMPLE:

Make sure the settings on your phone have been correctly configured to enable GPRS. There are two ways to do this:

Some providers will send GPRS settings to the handset upon receiving an activation request via SMS. Depending on the provider, it may take a while for the settings to activate. Set up GPRS manually (process described below for many kinds of phones).

See below for country specific information

Manual Setup Process: Common process
1. Click “Menu”
2. Scroll to “Settings” and click.
3. Scroll to “Configuration” and click.
4. Scroll to “Personal configuration setting” and click. If there is an existing, configuration, click “Options” and click “Delete”.
5. Click “Options”.
6. Scroll to “Add New” and click.
7.Select “Web”.
8. Scroll to “Use preferred access point” and verify it says “Yes”.
9. Click “Back”
10. Scroll to “My web” which you’ve just created.
11. Click “Options” and click “Activate”.
12. Click “Back”.
13. Now in the main menu of the “Configuration Settings” page,
scroll to “Default configuration setting” and click.
14. Scroll “Personal configuration” and click.
15. Then, click “Default”.
16. Now we need to create an access point.
17. Scroll to “Personal configuration setting” and click.
18. Click “Options” and “Add New”.
19. Select “Access Point”.
20. Click “Access Point Settings”.
21. This step does not show up in all phones (if it doesn't skip to Step 22): Verify the first list item, “Data Bearer”, is “Packet Data”, if not click and change it to “Packet Data”. (If you can't find it here, go back to the original "Settings" menu and choose "Connectivity" instead of "Configuration", there is an option "Packet Data" -> "Packet Data Settings" --> "Edit Active Access Pt" --> "Packet Data Acc. Pt." )
22. Scroll to “Bearer Settings”, and click Scroll to “Packet data access point” and click.
23. Delete “internet” and type in your local network provider's access point name (APN) (for example, the access location for mCel in Mozambique is “isp.mcel.mz”.)
24. See below for known APNs.
25. Click “Ok”.
26. Click “Back” a few times to get to the “Personal Accounts” menu. In this menu, you should see “My web” and “My access point” which are the settings you’ve just created.
27. Scroll to “My access point” which we just created.
28. Click “Options”.
29. Click “Activate”.
30. Click “Back”
31. Now “Configuration Setting Page”, we need to verify “My access point” is listed under “Preferred access point”.
32. Scroll to “Preferred access point” and click.
33. Scroll and click “My access point”.
34. Then, scroll to “Activate default in all apps” and click. (This will apply the settings you created to all applications on the phone, including CommCare).
35. Make sure to perform a CommCare "network test" before before you distribute the phone.

0

精彩评论

暂无评论...
验证码 换一张
取 消