Pages

Tuesday, February 19, 2008

J2ME+Polish+Netbeans+Linux Is possible ...

Dear all,

If somebody doubt "How linux can be used for proffesional J2ME development?" But , I would say "Yes, Its very much feasible"

Netbeans & Mobility Pack Instalation :

First of all get your copy of Netbeans mobility pack.

Get free CD from Netbean containing JDK, Latest Netbeans ( IDE & Mobility plugin )
http://www.netbeans.org/about/media.html
OR
download mobility pack & Netbeans IDE

wtk 2.2 download for Linux - Worked great with FC6 ;)
http://java.sun.com/products/sjwtoolkit/download-2_2.html

Latest wtk and jdk are available :
http://java.sun.com/javame/downloads/index.jsp

If you dont like to use emulator provided by wtk, we can also use microemulator(see on source forge)

J2me-Polish integration with Netbeans

Get j2me-polish latest jar , run it using
java -jar j2me-polish.jar

start a new installation procedure for j2me-polish

Follow below steps to make polish working with netbeans :

For integrating J2ME Polish with NetBeans 4.0 create a new project and copy the sample project from ${polish.home}/sample into your new project with a filemanager.
Rightclick the build.xml and choose "Run Target" > "j2mepolish" for running the example.
• Create a new project:
Go to "File" >"New Project" and select "Mobile" >"Mobile Application"
as your project type. Give the project any name and choose any folder as the
project's home. Deselect the "Create Hello MIDlet"option and select "Finish" to create the
project.
• Copy the sample project: Navigate to the "${polish.home}/sample" directory with your filemanager (e.g. Windows Explorer on Windows or Finder on Mac OS X). Select the "resources", "resources2" and "src" folders as well as the "build.xml" file and copy all into the folder of your NetBeans project. Overwrite any existing files.
• Return to NetBeans, rightclick
your new project in the "Projects" view and select "Refresh
Folders". You can now view the sample application in the "de.enough.polish.example" package.
• Right click your project again and select "Properties". Go to "Build" and select "Libraries and
Resources". Select "Add Jar/Zip" and add the "${polish.home}/import/enoughj2mepolishclient.jar" file to your project.
• Now switch to the "Files" view and right click the "build.xml" file. Select "Run Target" >
"Advanced". Write "test, j2mepolish" in the following dialog, so that the "test" target is executed first, followed by the "j2mepolish" target. J2ME Polish now executes and starts the WTK emulator



I hope , once you get above things installed , we can proceed for any kind of development of J2ME..

:)

Enjoy.

Wednesday, February 13, 2008

Reliance Huwai - Data Card on FC6 Linux


To configure Reliance data card (Huwai) on Dell D520 with FC6, hope it works in same manner on other laptops and linux too

Just follow below steps after adding data card inside slot.


After inserting data card see
# cat /proc/bus/usb/devices

.....
.....
T: Bus=02 Lev=01 Prnt=01 Port=05 Cnt=02 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=16 #Cfgs= 1
P: Vendor=12d1 ProdID=1001 Rev= 0.00
S: Manufacturer=Huawei Technologies
S: Product=Huawei Mobile
S: SerialNumber=HUAWEI EC3X1
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=pl2303
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
E: Ad=8a(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=0b(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=pl2303
E: Ad=83(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=06(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms

If you cant see, Use grep

Now modprobe the driver

Code:
# modprobe usbserial vendor=0x12d1 product=0x1001
Should get something like this with dmesg
Code:
# dmesg
[ 2315.412106] usbcore: registered new interface driver usbserial
[ 2315.412508] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[ 2315.461938] usbcore: registered new interface driver usbserial_generic
[ 2315.461945] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[ 2315.480382] drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
[ 2315.480414] pl2303 2-6:1.0: pl2303 converter detected
[ 2315.480608] usb 2-6: pl2303 converter now attached to ttyUSB0
[ 2315.480620] pl2303 2-6:1.1: pl2303 converter detected
[ 2315.480691] usb 2-6: pl2303 converter now attached to ttyUSB1

Now edit your wvdial.conf file

Code
# vi /etc/wvdial.conf
[Modem0]
Modem = /dev/ttyUSB0
Baud = 115200
SetVolume = 0
Dial Command = ATDT
Init1 = ATZ
FlowControl = Hardware (CRTSCTS)
[Dialer cdma]
Username = You Phone Number Here
Password = Your Password ... usually same as your phone number
Phone = #777
Stupid Mode = 1
Inherits = Modem0


In my case , it looks like this


#more /etc/wvdial.conf
[Modem0]
Modem= /dev/ttyUSB0
Baud= 115200
SetVolume= 0
DialCommand= ATDT
FlowControl= Hardware(CRTSCTS)
[Dialer cdma]
Username=
Password=

Phone=#777
Stupid Mode= 1
Inherits= Modem0


One more thing, add nameserver to
/etc/resolv.conf

[root@localhost ~]# more /etc/resolv.conf
# generated by NetworkManager, do not edit!
nameserver 202.138.103.100
nameserver 202.138.97.193
nameserver 127.0.0.1




Code:
# wvdial cdma
--> WvDial: Internet dialer version 1.56
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
ATDT#777
CONNECT 230400
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat Mar 3 22:55:20 2007
--> Pid of pppd: 24314
--> Using interface ppp0
--> local IP address 220.226.50.126
--> remote IP address 97.239.2.10
--> primary DNS address 202.138.103.100
--> secondary DNS address 202.138.96.2

Thats it ... you are now connected

U can now check ifconfig

[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:B9:81:69:DE
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:181361 errors:0 dropped:0 overruns:0 frame:0
TX packets:17751 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19484952 (18.5 MiB) TX bytes:1573958 (1.5 MiB)
Interrupt:17

eth1 Link encap:Ethernet HWaddr 00:1B:77:81:44:FE
inet addr:172.16.13.81 Bcast:172.16.13.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:188454 errors:0 dropped:4871 overruns:0 frame:0
TX packets:21426 errors:0 dropped:0 overruns:0 carrier:685
collisions:0 txqueuelen:1000
RX bytes:16911463 (16.1 MiB) TX bytes:2128728 (2.0 MiB)
Interrupt:17 Base address:0xe000 Memory:efdff000-efdfffff

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3124 errors:0 dropped:0 overruns:0 frame:0
TX packets:3124 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4018312 (3.8 MiB) TX bytes:4018312 (3.8 MiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:220.224.115.210 P-t-P:220.224.134.73 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:828 errors:1 dropped:0 overruns:0 frame:0
TX packets:1151 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:421748 (411.8 KiB) TX bytes:119826 (117.0 KiB)

ppp0 is ur n/w connection

Once you see above o/p of # ifconfig

Add default gateway as below
#route add default gw
220.224.134.73 netmask 0.0.0.0

Now We can see

[root@localhost ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
220.224.134.73 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
172.16.13.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
0.0.0.0 220.224.134.73 0.0.0.0 UG 0 0 0 ppp0

For more info
http://fedorahacks.com/node/7
http://www.linuxquestions.org/questions/linux-laptop-and-handheld-25/configuring-datacard-on-my-laptop-601597/
http://www.rimweb.in/forums/lofiversion/index.php/f4.html
http://www.linuxquestions.org/questions/linux-laptop-and-handheld-25/configuring-datacard-on-my-laptop-601597/

Wireless on Dell D520 with Linux-FC6

Dear FC users,

Please refer to
http://forums.fedoraforum.org/showthread.php?t=148278
follow steps to get your wireless working.

file /etc/sysconfig/network-scripts/ifcfg-eth1
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
IPV6INIT=no
ONBOOT=yes
TYPE=Wireless
DEVICE=eth1
HWADDR=00:1b:77:81:44:fe
#BOOTPROTO=none
BOOTPROTO=dhcp
ESSID=
RATE=Auto
MODE=Managed
CHANNEL=1
USERCTL=yes
PEERDNS=yes

For Wired connection, you may be having something like this at eth0
[root@localhost network-scripts]# more ifcfg-eth0
# Broadcom Corporation BCM4401-B0 100Base-TX
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:19:B9:81:69:DE
ONBOOT=yes
TYPE=Ethernet

Start NetworkManager in background, it automatically searches and get the available networks in range.
command NetworkManager

Meanwhile also monitor /var/log/message
You 'll be asked for some password/key, just put 123 or something.
I got it working on my machine.

For winamp & Other Media Plyers on FC-6

Install Media player
Xmms:
yum resolvedep xmms
yum install xmms xmms-check xmms-plugin
yum -y install xmms xmms-mp3 xmms-faad2 gstreamer-plugins-ugly libmad libid3tag

Xine :
yum -y install xine xine-lib xine-skins

Vlc Player :
yum -y install videolan-client

command xmms will play mp3 for you.



I feel above information 'll be helpful for you to configure Wireless.
Thanks.

Cheers,