CIS - The Project by UCC
Thursday, July 14, 2011
Android - join CSI Hyderabad for Project mentoring
go to csihyderabad.ning.com and register yourself (doesn't take too long).
this will connect us to some experienced folks in Hyderabad who are working in the mobile space. It will help us in executing projects.
A programming contest that sounds cool
Here is a programming contest if you are interested. There are big names being thrown - Carnegie Mellon University and it seems like a very accomplished set of people running ISE - the organization behind this contest.
Extreme Engineering (E2)
Professors from the Carnegie Mellon University and ISE have designed a software programming contest to identify the best talent in India. It is free to participate and you can also win exciting prizes including an exclusive invitation to a workshop by Dr. Jaime Carbonell of CMU on 17th July, 2011 at Novotel, Hyderabad.
· It is online (you can take it from home)
· There are many winners (over 300 prizes)
· It exposes you to best problems (set by professor of CMU)
You can get more details at http://contests.iseweb.in
Sunday, July 10, 2011
Mobile Projects on Android
Some of you have already started working on Android and that is great. I would like you to do a project that has a beneficial social impact and will be a great challenge as well.
In the past 2 years in Hyderabad i have thought hard on how to resolve the trash mess we create in the city. Most of us throw our trash on the road, some of us engage waste collectors (who come in rickshaws) to pick up our trash and the rest of us probably use a dust bin provided by GHMC or any other municipality.
But the municipality does not recognize the great role played by waste collectors (also called Rag Pickers) in keeping our city clean and in recycling much of the waste we generate.
I would like an android application that will take the picture of a waste collector, collect basic information from them like a mobile phone number (yes, many of them carry one), ration card number (if any) or aadhaar card (if any).
We will have volunteers in the city download this application and use it to register waste pickers wherever we find them (we will explain to them the benefits of registering).
Once we create the database we can approach municipality (or the courts if the municipality does not listen to us) and present this data. We can then formally register a union of these workers, bring them benefits that are much needed for their families (most of their children are unable to go to school because they accompany them for picking waste).
Who can take this up as an application and work on it.
The most important feature is - once a waste picker is registered, if he or she is located again - the application should take a picture and compare it with the pictures it has on the database to correctly recognize the person.
I will also connect you to some programmers who are working on mobile applications in Hyderabad. You will receive this information soon.
Saturday, July 9, 2011
OOPS - There is no class called GBHelper
Alas, there is no class called GBHelper in standard java library. We would have to make one.
Using GBHelper to get more out of GridBagLayout
Here is an example of how GBHelper has been used along with GridBagLayout to create a neat GUI.
Check out the code in http://leepoint.net/notes-java/GUI/layouts/gridbag-example.html
Also pasted here for your convenience.
Can we use this to make our registration form better?
// File : layoutDemos/layoutDemoGB/DemoGridBag.java
// Purpose: Show how to make a GridBagLayout using helper classes.
// Two GridLayout subpanels of checkboxes and buttons are
// created because these components have no alignment
// in common with other parts of the GUI. They are then
// added to the GridBagLayout as components.
// Author : Fred Swartz - 2007-02-02 - Placed in public domain.
package layoutdemogb;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
//////////////////////////////////////////////////////////////////// DemoGridBag
public class DemoGridBag extends JFrame {
//================================================================ constants
private static final int BORDER = 12; // Window border in pixels.
private static final int GAP = 5; // Default gap btwn components.
//=================================================================== fields
//... GUI components
JLabel findLbl = new JLabel("Find What:" , JLabel.LEFT);
JLabel replaceLbl = new JLabel("Replace With:", JLabel.LEFT);
JTextField findTF = new JTextField(20);
JTextField replaceTF = new JTextField(20);
JButton findBtn = new JButton("Find");
JButton replaceBtn = new JButton("Replace");
JButton replAllBtn = new JButton("Replace All");
JButton closeBtn = new JButton("Close");
JButton helpBtn = new JButton("Help");
JCheckBox matchCaseCB = new JCheckBox("Match Case");
JCheckBox wholeWrdsCB = new JCheckBox("Whole Words");
JCheckBox regexCB = new JCheckBox("Regular Expressions");
JCheckBox highlightCB = new JCheckBox("Highlight Results", true);
JCheckBox wrapCB = new JCheckBox("Wrap Around", true);
JCheckBox selectionCB = new JCheckBox("Search Selection");
JCheckBox backwardsCB = new JCheckBox("Search Backwards");
JCheckBox incrementCB = new JCheckBox("Incremental Search", true);
JDialog replaceDialog = new JDialog();
//============================================================== constructor
public DemoGridBag() {
//... Create a dialog box with GridBag content pane.
replaceDialog.setContentPane(createContentPane());
replaceDialog.setTitle("Find Replace");
replaceDialog.pack();
replaceDialog.setLocationRelativeTo(this);
//... Create a button for the window to display this dialog.
JButton showDialogBtn = new JButton("Show Find/Replace Dialog");
showDialogBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
replaceDialog.setVisible(true);
}
});
//... Create content pane with one button and set window attributes.
JPanel windowContent = new JPanel();
windowContent.setLayout(new BorderLayout());
windowContent.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
windowContent.add(showDialogBtn, BorderLayout.CENTER);
//... Set the window characteristics.
super.setContentPane(windowContent);
super.pack(); // Layout components.
super.setTitle("DemoGridBag");
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
super.setLocationRelativeTo(null); // Center window.
}
//======================================================== createContentPane
private JPanel createContentPane() {
selectionCB.setEnabled(false);
//... Create an independent GridLayout panel of buttons.
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new GridLayout(5, 1, GAP, GAP));
buttonPanel.add(findBtn);
buttonPanel.add(replaceBtn);
buttonPanel.add(replAllBtn);
buttonPanel.add(closeBtn);
buttonPanel.add(helpBtn);
//... Create an independent GridLayout panel of check boxes.
JPanel checkBoxPanel = new JPanel();
checkBoxPanel.setLayout(new GridLayout(4, 2));
checkBoxPanel.add(matchCaseCB);
checkBoxPanel.add(wrapCB);
checkBoxPanel.add(wholeWrdsCB);
checkBoxPanel.add(selectionCB);
checkBoxPanel.add(regexCB);
checkBoxPanel.add(backwardsCB);
checkBoxPanel.add(highlightCB);
checkBoxPanel.add(incrementCB);
//... Create GridBagLayout content pane; set border.
JPanel content = new JPanel(new GridBagLayout());
content.setBorder(BorderFactory.createEmptyBorder(BORDER, BORDER,
BORDER, BORDER));
//\\//\\//\\//\\//\\ GridBagLayout code begins here
GBHelper pos = new GBHelper(); // Create GridBag helper object.
//... First row
content.add(findLbl, pos);
content.add(new Gap(GAP), pos.nextCol());
content.add(findTF , pos.nextCol().expandW());
content.add(new Gap(GAP), pos.nextCol());
content.add(buttonPanel , pos.nextCol().height(5)
.align(GridBagConstraints.NORTH));
content.add(new Gap(GAP) , pos.nextRow()); // Add a gap below
//... Next row.
content.add(replaceLbl , pos.nextRow());
content.add(new Gap(GAP), pos.nextCol());
content.add(replaceTF , pos.nextCol().expandW());
content.add(new Gap(2*GAP), pos.nextRow()); // Add a big gap below
//... Last content row.
content.add(checkBoxPanel, pos.nextRow().nextCol().nextCol());
//... Add an area that can expand at the bottom.
content.add(new Gap() , pos.nextRow().width().expandH());
//\\//\\//\\//\\//\\ GridBagLayout code ends here
return content;
}
//===================================================================== main
public static void main(String[] args) {
//... Set Look and Feel.
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception unused) {
// Nothing can be done, so just ignore it.
}
//... Start up GUI.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
DemoGridBag window = new DemoGridBag();
window.setVisible(true);
}
});
}
}
GBHelper - Helper class to represent the constraints
Using the raw GridBagConstraints class to specify the layout characteristics of each element is awkward, the two constructors take either no arguments or eleven arguments. The properties are all public fields, so it's possible to assign to them and share one GridBagConstraints object, but this usually becomes a source of much aggravation.
Helper class. A common solution is to define a helper class which makes it easier to work with a GridBagConstraints object. I've defined one such class below which is a subclass of GridBagConstraints, but there are many other variations available on the Internet.
1 | // File : layoutDemos/layoutDemoGB/GBHelper.java |
Gap - Helper class to build gaps
This class is used just to create elements to fill in the gaps. There are other ways, such as using the Box class methods to create rigid areas or glue.
1 | // File : layoutDemos/layoutDemoGB/Gap.java |
Friday, July 8, 2011
Run Android on Your Netbook or Desktop
Run Android on Your Netbook or Desktop
Would you like to try out Google’s Android OS on your netbook or desktop? Here’s how you can run Android from a flash drive and see how fast Android can run on real hardware!
Install Android On Your Flash Drive or Memory Card
First, make sure you have a flash drive or memory card inserted into your computer with around 256MB or more storage space. Remove any files you may need off of the drive, so you can use it to run Android on your computer.
Now you’re ready to download and setup Android on your drive. Head over to the Android x86 download page (link below), scroll down to the StableRelease section, and click View under android-x86-1.6-r2.iso. This will start the iso file downloading to your computer.
In the mean time, head over to the UNetbootin site (link below), and download it as well.
Once your downloads are complete, run UNetbootin. Click the bullet beside Diskimage, then click the “… “ button and select the Android ISO file you just downloaded. Finally, select the correct flash drive or memory card in the menu on the bottom, and click Ok.
UNetbootin will now copy the files to your flash drive. This may take a few moments, depending on your flash drive’s speed.
Once it’s finished, it will ask if you wish to reboot. If you want to go ahead and run Android, you can click Reboot; otherwise, just exit and run Android from your flash drive when you want.
If you want to try Android on a computer that has a CD/DVD drive, you could just burn the ISO to a disk and boot from it. Netbooks don’t have CD drives, and even on a desktop, it can be nice to not waste a CD just for this. If you want to burn it to a disk, you can do it easily from Windows 7 or with a free program such as ImgBurn.
Using Android-x86 On Your Computer
Now you’re ready to run Android on your netbook, laptop, or even a full desktop computer. Simply reboot your computer with the USB drive, and select to boot from it. Not all computers will automatically boot from a USB device, so you may have to press F2, F10, or another key, depending on your computer, and change the Boot options in the bios.
Now, when you boot from the USB drive, select Live CD – Run Android-x86 without installation.
You’ll see a text prompt for a few moments as Android begins to load.
Then you’ll see the Android boot screen, though we only saw it for a moment, as our computer booted really fast into Android.
After a couple seconds, you’ll see the Android desktop … on your netbook or computer! You can quickly access one of the apps on the home screen, or open the menu to see more options.
Click and hold to open a context menu, such as to change the background or add a desktop widget.
Or, press your mouse’s right button to open a menu, such as to open a new tab in the browser.
It works very good as a quick way to get online; the Android browser is actually quite capable for normal browsing, and worked very well in our tests. With a 10 second or less boot time, you may enjoy using this as an alternate to Puppy Linux or other light distros for a quick way to get online securely.
You can even install new applications with the included AndAppStore, though these will only be installed while this Android session is running. If you reboot your computer, you’ll only see the default applications and settings again.
Android x86 supports all of the hardware, including cameras and Wi-Fi, on several Netbooks and laptops; check the link below to see if yours is supported. In our test, our camera wasn’t supported, and we additionally had to connect to the internet via Ethernet since it didn’t detect our Wi-Fi card.
For the most part, Android was very responsive, but anything that would fade out the desktop such as opening a dialog box or a menu would run very slowly and even make the mouse feel jerky. Additionally, we couldn’t get it to boot on our desktop with an AMD processor. You could install Android to your hard drive, but we wouldn’t recommend it considering the limitations and issues it has. But, it is very fun to play with from a flash drive or memory card, and you may even feel adventurous enough to try installing it. Be warned, though; this isn’t for the weak of heart!
Conclusion
If you’re curious about how Android works and would like to try it out on a real machine, this is a great way to see how fast a mobile OS can be on a netbook or desktop. We wish it was more stable and could actually store programs and settings on the flash drive, but it did work as a nice substitute for Puppy Linux or other light, Live CD distros. It runs much faster on a real computer than in the emulator. Since you’re running it from a flash drive, you don’t have to worry about messing anything up, so go ahead and try it for research or fun.
Or, if you’d rather just try out Android from inside Windows, check out our articles on How to Test Drive Android in the Android Emulator and How to Enable the Android Market in the Emulator to try out the best Android has to offer.
Links