Showing posts with label under. Show all posts
Showing posts with label under. Show all posts
Saturday, August 26, 2017
Success! Symphony Gofox F15 ADB connection working under Ubuntu!
Success! Symphony Gofox F15 ADB connection working under Ubuntu!
Recently I bought a Symphony Gofox F15 Firefox OS phone that is available in Bangladesh for $60 (4650 BDT). I bought a used one from bikroy.com with 3100 BDT. It is not a very appreciable set in terms of performance but it works. It is a Firefox OS 1.4 phone having 512mb RAM & ROM that gets a bit slow on heavy usage.
As a Web Developer myself I am thrilled that an entire mobile phone can be operated from browsers. If you are new to the trend, everything you see on FFOS is running on browsers, every button that you click is a <a> or <button> tag, every image that you see is either CSS or an <img> tag. So the OS takes very less RAM and resources to run, on theory.
But I must admit, some features are very well thought and they are way ahead compared to some earlier versions of Android. The 2.0 version also comes with a brilliantly designed UI thatll impress you for sure.
The good fun in ADB connection is the fact that you can run the app, debug it, touch different elements and inspect it in real time from your desktop PC! You can even modify styles of app drawer in an instant and with only changing some good old CSS codes.
As you expect, as it is less used in Bangladesh, I couldnt find the appropriate drivers for the phones ADB connection. Although Mass storage worked right out of the box. The conclusion is, in Windows (both 32 & 64 bit) I failed to load it in WebIDE. But I succeeded in Ubuntu. Heres how I did it:
First ran the command on terminal:
2. Now run:
Earlier versions are less likely to work. It is best to get the latest possible version.
Get the Firefox tar file, extract it in a directory like this:
2. Installed the ADB Helper
from here: https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/
2. Disabled Screen Lock from Settings -> Screen Lock (Because if the screen lock comes, the debug bridge will be stopped.)
3. Most importantly, enabled Developer menu, Settings -> Device Information -> More Information and checked "Developer Menu". A Developer item is now revealed in the Settings.
Then enabled ADB option from Settings -> Developer -> Remote Debugging -> ADB and Devtools.
1. Found a good cable from another phone and conneted with it. The cable given in the box does not work. Also sometimes, I heard, using a USB port directly on the motherboard helps. But I used extension cord and still got connection. I was lucky!
2. Started Firefox Nightly (from home/Apps/firefox) and opened about:app-manager through the addressbar. It showed a button with a strange number at the bottom. I clicked on it. It showed some errors, like this:

3. Out of curiosity I ignored the message and then tried opening the WebIDE (from Firefox menu -> Developer -> WebIDE.) and it showed the device in the Menu on the right side! This time it also showed the strange number, not exactly the device name (S32SV2B000010123). But I clicked on it anyway.
(After requesting connection with the device, there will be a message in your phone asking whether you want your Desktop to connect with your phone. Tap on OK button on your phone when it comes.)
Surprisingly, it connected!
4. I disabled and re-enabled ADB from Settings, started Firefox Nightly, plugged in the phone, started WebIDE and voila! It came with the right name!
Here goes a screenshot to my success!

2. Use a good quality cable
3. Connect it directly in the USB port of motherboard
4. Try enabling and disabling ADB option if doesnt get detected
5. Use this page to troubleshoot .
Anytime I wanted to connect, I just followed the point 4 under step 4.
Now I can create Apps in my Firefox browser and run it directly on my phone! yayy!
Help & ref:
https://bugzilla.mozilla.org/show_bug.cgi?id=936909
https://developer.mozilla.org/en-US/docs/Tools/WebIDE/Troubleshooting
As a Web Developer myself I am thrilled that an entire mobile phone can be operated from browsers. If you are new to the trend, everything you see on FFOS is running on browsers, every button that you click is a <a> or <button> tag, every image that you see is either CSS or an <img> tag. So the OS takes very less RAM and resources to run, on theory.
But I must admit, some features are very well thought and they are way ahead compared to some earlier versions of Android. The 2.0 version also comes with a brilliantly designed UI thatll impress you for sure.
The good fun in ADB connection is the fact that you can run the app, debug it, touch different elements and inspect it in real time from your desktop PC! You can even modify styles of app drawer in an instant and with only changing some good old CSS codes.
As you expect, as it is less used in Bangladesh, I couldnt find the appropriate drivers for the phones ADB connection. Although Mass storage worked right out of the box. The conclusion is, in Windows (both 32 & 64 bit) I failed to load it in WebIDE. But I succeeded in Ubuntu. Heres how I did it:
Connecting Gofox F15 for ADB/WebIDE in Ubuntu:
Step 1: Prepping the Ubuntu:
1. Created an udev rule for the device.First ran the command on terminal:
sudo gedit /etc/udev/rules.d/51-android.rulesThen added the following code in the file and saved:
SUBSYSTEM=="usb", ATTRS{idVendor}=="1782", MODE="0666"(I got the 1782 value from running lsusb command.)
2. Now run:
sudo service udev restart
Step 2: Prepping Firefox Desktop:
1. Got the latest Firefox Nightly for Linux (currently version 38) from hereEarlier versions are less likely to work. It is best to get the latest possible version.
Get the Firefox tar file, extract it in a directory like this:
cd ~(I have created and chosen the "Apps" directory. You can use any directory you want.)
mkdir Apps
cd Apps
tar xvf path/to/firefox-xxx.tar
2. Installed the ADB Helper
from here: https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/
Step 3: Prepping the Phone:
1. Turned on the USB Storage option from Settings2. Disabled Screen Lock from Settings -> Screen Lock (Because if the screen lock comes, the debug bridge will be stopped.)
3. Most importantly, enabled Developer menu, Settings -> Device Information -> More Information and checked "Developer Menu". A Developer item is now revealed in the Settings.
Then enabled ADB option from Settings -> Developer -> Remote Debugging -> ADB and Devtools.
Step 4: Bridging the ADB:
1. Found a good cable from another phone and conneted with it. The cable given in the box does not work. Also sometimes, I heard, using a USB port directly on the motherboard helps. But I used extension cord and still got connection. I was lucky!
2. Started Firefox Nightly (from home/Apps/firefox) and opened about:app-manager through the addressbar. It showed a button with a strange number at the bottom. I clicked on it. It showed some errors, like this:
12:34:56: connection error. Possible causes: USB port not connected, port not forwarded (adb forward), wrong host or port, remote debugging not enabled on the device.

3. Out of curiosity I ignored the message and then tried opening the WebIDE (from Firefox menu -> Developer -> WebIDE.) and it showed the device in the Menu on the right side! This time it also showed the strange number, not exactly the device name (S32SV2B000010123). But I clicked on it anyway.
(After requesting connection with the device, there will be a message in your phone asking whether you want your Desktop to connect with your phone. Tap on OK button on your phone when it comes.)
Surprisingly, it connected!
4. I disabled and re-enabled ADB from Settings, started Firefox Nightly, plugged in the phone, started WebIDE and voila! It came with the right name!
Here goes a screenshot to my success!

Remarks:
1. Use shorter cable if possible2. Use a good quality cable
3. Connect it directly in the USB port of motherboard
4. Try enabling and disabling ADB option if doesnt get detected
5. Use this page to troubleshoot .
Anytime I wanted to connect, I just followed the point 4 under step 4.
Now I can create Apps in my Firefox browser and run it directly on my phone! yayy!
Help & ref:
https://bugzilla.mozilla.org/show_bug.cgi?id=936909
https://developer.mozilla.org/en-US/docs/Tools/WebIDE/Troubleshooting
download file now
Monday, August 14, 2017
SwiftBoot kick starts Linux in under one second
SwiftBoot kick starts Linux in under one second

Are you happy that your Linux OS boots up real quick, say in about 40-60 seconds ? Do you really think thats the best Linux can do ? Certainly not, Linux is getting better and better everyday, it has come a long way and has proved to be considerably good at what it does. A company called MPC Data has developed a solution called swiftBoot that helps booting into a fully running Linux OS in under one second.
Heres a video demonstrating its booting speed:
No other gimmick involved other than optimizations done, as a result of a good understanding of the Linux system.
Heres another one on a TI OMAP3530 based OMAP3530EVM board. This time, they use a stop-watch for monitoring the performance.
The demos show that not only does the system soft-boot in within a second but it also function normally after that.
--Expecting to see more of such advancements in Linux systems.
download file now
Sunday, August 6, 2017
Struts Error Exception No getter method available for property name for bean under name
Struts Error Exception No getter method available for property name for bean under name
Recently I was using Struts v1.x and I needed to display a select list. The information about how to use the html:optionsCollection tag was sketchy. I was able to get the tag working this way:
On the JSP page, I added this inside the html:form tag:
<html:select property="selectedEquipment"> <html:optionsCollection property="equipment" label="name" value="id"/> </html:select>
Then I create a Java class called SelectOption like this:
package com.codebits.struts; public class SelectOption { String id; String name; SelectOption() { } SelectOption(final String _id, final String _name) { setId(_id); setName(_name); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } Next I created an ActionForm bean:
package com.codebits.struts; public class AddForm extends ActionForm { private Integer selectedEquipment = null; private List equipment = new ArrayList(); public Integer getSelectedEquipment() { return selectedEquipment; } public void setSelectedEquipment(Integer selectedEquipment) { this.selectedEquipment = selectedEquipment; } public List getEquipment() { return equipment; } public void addEquipment(final String equipmentId, final String emtEquipmentId) { this.equipment.add(new SelectOption(equipmentId, emtEquipmentId)); } public void setEquipment(List equipment) { this.equipment = equipment; } } And finally, in my action class, I prepopulated the ActionForm bean:
AddForm addForm = (AddForm)form; addForm.addEquipment("1", "AAA"); addForm.addEquipment("2", "BBBB"); download file now
Subscribe to:
Posts (Atom)