I took his code and encapsulated it into my Plugin and added an option to choose between the old image type ribbons and the new CSS3 ribbons.
The new CSS3 ribbons are really cool and you can see them in action in my blog. The only caveat is that, they don’t work in IE (but who cares ;))
Download
This is an optional update. If you want to use the cool CSS3 ribbons, then you can download the latest version of the Plugin from the Plugin’s homepage or update it using the Plugin installer.
Feedback
Please keep the feedback coming and if you want me to add any new features or find a bug, please leave a comment.
Stay updated
I would be posting updates about this Plugin in my blog and in Twitter. If you want to be informed when new version of this Plugin is released, then you can either subscribe to this blog’s RSS feed or follow me in Twitter.
After paid apps were introduced in Android market for Indian users, I wanted to buy a couple of them. But it took me a couple of days to do it, because of a variety of related and un-related issues. I thought of documenting it here, so that it would be useful for others who are facing the same problem.
The first issue that I faced was that, I have associated my phone with my Google App account and not a regular gmail account. Because of this, I was not able to use Google Checkout to buy paid apps. To fix this, I was supposed to add another Google account that has Google checkout enabled.
The second issue is that, there is some bug in android which doesn’t allow you to add additional accounts. The symptom of this bug is that you will get a error message which says “You don’t have a network connection”, even though you are connected through wifi or gprs. It took me a couple of days to figure out that it is a bug. Searching the internet revealed, that this bug is found across devices and across Android OS versions. I really wonder why Google has not fixed it yet.
Anyways, after searching sometime, I found out a relatively easy fix. You can try to add the account using the Youtube app. The following are the steps to do that.
Open up your Youtube app
Select menu –> My account and then click Add Account. Enter the new email address
Go back to your home screen and then select Menu -> Settings -> Accounts & sync
Set sync settings there and put in the password when prompted
Now you can go to the Market app and start buying paid apps. 🙂
This release also includes couple of bug fixes which were reported in the forums. Notable among them are
“Recent Notes” works better.
Phone number / IM field deletion on edit has been fixed.
Plugins
This release also has a couple of Plugins added to the core, which can be activated separately.
RoloPress Import: probably our most requested feature. You can now import any Outlook CSV file into RoloPress. We choose Outlook CSV because most contact managers allow you to export in this format.
Another important milestone of this release is that, this release includes code from a third developer apart from me and Steve. The third developer is Mike Whitfield, who contributed the front-end tag editing code. Welcome Mike 🙂
Download
You can download the latest version from the homepage and if you are interested, you can check out the source code at github.
Try it out and if you have any feedback, please post it here or in the forums.
I wanted to visualize data using graphs in one of the Android app that I was developing and found that Android SDK don’t provide a good graphing API, which you can use out of the box.
You have to either using Canvas 2D graphics to draw your graphs from scratch or use some commercial components.
If you can assume that some form of Internet connection will be available then you can use Google Graphs API to get the graph and embed it in a webview control. But I didn’t wanted to make that assumption and so I started to search for a good graph component, which I can use in my app.
After some frustrated search attempts, I stumbled upon a wiki at rapid android, which explained, how you can use jQuery based JavaScript library flot to draw graphs for android. At first I dismissed it, since I didn’t wanted to assume that an active Internet connection would be available for my app. But after reading it for the second time, I realized that the graphs could be drawn using HTML and JavaScript files stored locally, without the need to be connected.
So I wrote a sample app to try it out and it really worked out great. I thought of posting the source code and a little writeup about it so that it would be useful for others as well.
Goal
So my goal was to create graphs in android using any JavaScript or HTML that are stored locally. The app and the graphs should work even if access to Internet is not available.
Flot
Flot is a jQuery based JavaScript library that was easy to use and created powerful and feature-rich graphs. The main advantage of flot is that it is completely compatible with the browser that is available in android.
Setting up webview
The first thing that we have to do is to setup webview, which will be rendering the HTML page, on which we will be drawing the graph. You can add the webview control to your android layout.xml file using the following code.
Once it is added to your layout.xml page, you can access it in your activity using the following code.
Adding the HTML page to assets folder
The next step is to place the HTML, CSS and JavaScript files into the /assets folder. You should have the files only in the assets folder and not in any arbitrary folder because webview can only open files which are placed in the /assets folder.
Also add the flot and jQuery files into the /assets folder and refer to them with relative urls in your HTML file. You can also checkout the HTML file that I have created for reference.
Once you add the HTML file, you can load it in your webview using the following code snippet.
Connecting Java and JavaScript
We will be adding an interface to the webview (by calling the addJavascriptInterface method) which will allow us call JavaScript methods from the Java code.
In the Java side, we have to create a separate class, which can be used to interact with JavaScript and pass data between the two worlds. Check out the following code snippets to find out how to do it.
Check out the StatsGraphHandler class in my sample project for reference.
Enjoy your graph
That’s it 🙂 Fire up your app and you can see the excellent graph generated.
Advanced usage
You can also add some buttons in the HTML page, which can directly interact with the graph. For other options, check out flot’s documentation.
Sample Code
You can download the complete code of the sample app that I created from my github account.
Just wrote quick some code sample to show how to access YQL (Yahoo Query Language) queries from PHP.
You can use the following code sample to fetch results from YQL from any standard PHP file. You would require the curl extension to be installed. If you are behind a proxy, uncomment the 3 lines and replace it with proper proxy values
If you have the Yahoo social SDK installed and you want to access results from YQL, then you can use the following code sample. Replace the text consumer_key and consumer_secret with correct values.
Just a quick note to let you know that O’Reilly is conducting a webcast on using CouchDB on Android phone tomorrow, Sep 22, 2010 at 10 AM PST (10:30 PM IST).
Agenda
Following is the agenda
Why CouchDB on a phone is awesome, and what you can do with it
Deploying existing CouchApps to Android CouchDB
Using CouchDB in native Android apps
Aaron Miller who works for Couch.io is going to conduct this webcast. If you are interested in Android or CouchDB, then you should definitely attend it.
You can register for the webcast from the event page.
One of the main complaints I heard about my Google Scribe Plugin is that, certain users found it distracting and wanted a way to disable it.
In the first version of the Plugin, you have to manually disable it for every page load. Now, I have added an option in the comment form, so that end users who visit your site can disable it, if they want to.
This preference is stored in the user’s browser as a cookie and so next time when he tries to comment on any other page/post from your blog it will not be enabled till he enables it.
Download
This is an optional update. If you want the ability to disable it, then you can download the latest version of the Plugin from the Plugin’s homepage or update it using the Plugin installer.
Feedback
Please keep the feedback coming and if you want me to add any new features or find a bug, please leave a comment.
Stay updated
I would be posting updates about this Plugin in my blog and in Twitter. If you want to be informed when new version of this Plugin is released, then you can either subscribe to this blog’s RSS feed or follow me in Twitter.
Recently I was writing a small UI tool in Java Swing at work and found a strange bug in Java Swing, which was first reported in 1998 but is not fixed yet. I thought of documenting the workaround here so that it is useful for others who are faced with the same problem.
I wanted to trigger a popup menu when a right click event happens on a JComboBox (drop-down) component. I tried adding a MouseListener to the JComboBox, but it was not getting triggered. After spending a couple of hours, I finally came to know that it was because of a bug in Java Swing. The worst part is that the bug was closed as “Will not fix”
Fortunately, there is a workaround for this. Instead of adding the MouseListener to the JComboBox, you have to add it to all its children, like how it is done in the following code snippet.
After implementing this fix, I was able to trigger the popup when the combo box was right-clicked. Hope this helps someone who is affected by this bug.
I have updated my Twitter Avatar Reloaded Plugin, which can be used to display user’s Twitter Avatar instead of Gravatar in comments.
New Features
The following are the new features that I have added to the Plugin
Support for registered users
Ability to specify the text of the Twitter field in the settings screen
Removed JavaScript from unnecessary pages which should improve performance.
Download
This is a mandatory update. You can download the latest version of the Plugin from the Plugin’s homepage or install it using the Plugin installer.
Feedback
Please keep the feedback coming and if you want me to add any new features or find a bug, please leave a comment.
Stay updated
I would be posting updates about this Plugin in my blog and in Twitter. If you want to be informed when new version of this Plugin is released, then you can either subscribe to this blog’s RSS feed or follow me in Twitter.