Saturday 18 August 2012

And Bible on a 7" Chinese Ainol Tablet

Having used And Bible extensively on a G1 and a Nexus One mobile for 2 years I recently purchased a cheap 7" Chinese Ainol tablet.  Here follows a summary of my experience using And Bible on the Ainol Aurora.

Usage Pattern
The size of the tablet led to a different usage pattern to a mobile phone.  Being the size of a paperback it is easier to read the screen and so, instead of predominantly favouring Speak, I find myself reading more.  However, the larger size of the tablet also means the speaker is quite usable, meaning it is more acceptable to Speak text for my wife and I to listen to.

The tablet is just about pocketable if you have large pockets, but I cannot see myself walking around listening to books as I do with my mobile.

Strengths
The main strength is the screen size.

Price is another strong point.  What other nice ICS device can be bought for under £100!

Technical Limitations
There is no gravitational sensor in this tablet and so Tilt-to-scroll is automatically disabled.  There is an accelerometer so it should be possible to enable this feature, but with such a large screen tilt-to-scroll is not really necessary.

Performance
The 1Ghz chip is fast but not state of the art.  The tablet does slow down noticeably when a background task is running e.g. downloading, but if you keep removing unused tasks from memory using the excellent new ICS Task Switcher (swipe the app to the side) then performance seems better.

Update August 2012: And Bible runs great on a tablet but I would probably but a Nexus 7 rather than a cheap Chinese tablet.

Wednesday 13 June 2012

Examples of Using jQuery with JSF and Richfaces

I had difficulty finding examples of using jQuery with JSF and RichFaces so I have listed a couple of examples below.  My environment was Websphere 6.1, JSF 1.2, and Richfaces 3.3

Example 1
Add an onclick listener to all links.  Adapted from How jQuery Works:

<ui:define name="extraHeaderContent">
   <a4j:loadScript src="resource://jquery.js" />


<script language="javascript">
// use CDATA to prevent greater than in if statements being 
// interpreted as the start of a tag
//<![CDATA[
// ask jQuery to do what follows after the page is loaded
   jQuery(document).ready(function(){
   // find all links (a) and set a click handler
jQuery("a").click(function(event){
    alert("Thanks for visiting!");
    // do not go to the link
    event.preventDefault();
  }); 
});
//]]>
</script>
</ui:define>

Example 2
Allow users to paste from Excel into a series of JSF inputText fields.  The example will only work when using Microsoft Internet Explorer browser due to the use of window.clipboardData.  It is possible to make the below usable on other browsers but that was not one of my requirements.  It pastes a series of up to 12 numbers copied from Excel:


<ui:define name="extraHeaderContent">
    <a4j:loadScript src="resource://jquery.js" />
    
<script language="javascript">
//<![CDATA[
// wait until document is loaded before trying to find DOM elements
jQuery(document).ready(function() {
for (var i=0; i<12; i++) {
bindField(i);
}
});


function bindField(inputFieldNum) {
jQuery("#form\\:adjId"+inputFieldNum).bind('paste', function() {
var el = $(this);
       setTimeout(function() {
           clip(inputFieldNum);
       }, 0);
});
}


function clip(firstInputFieldNum) {
//http://stackoverflow.com/questions/1095131/paste-excel-data-into-html-table

   // get the clipboard text
   var clipText = window.clipboardData.getData('Text');


   // split into cells
   //Excel separates columns with tabs (chr(9)), rows with CR (chr(13)), but cater for various splitter chars
   var clipCells = clipText.split(/[\r\n\t,]/);
   var numCells = clipCells.length;


   if (numCells<=(12-firstInputFieldNum)) {
   // overwrite each month's adjustment figure with the clipCells
   for (var i=0; i<numCells; i++) {
   var elementName = 'form:adjId'+(firstInputFieldNum+i);
   document.getElementById(elementName).value = clipCells[i];
   }
} else {
alert('Too many cells');
}
}
//]]>
</script>
</ui:define>

Saturday 26 May 2012

Ainol Aurora 7" Tablet, 1GHz ARM, 1Gb ram, 8Gb internal, 1024x600 IPS screen

Update (August 2012): If you are thinking of buying a cheap tablet now then a Nexus 7 would probably better alternative.

Chinese tablets have been dropping in price and improving in quality.  I have long needed an ICS device and a tablet for development work and so I took the plunge and purchased an Ainol Aurora 7" Tablet with the latest Android OS ver 4.0.3.

Alternatives considered were the Kindle Fire and the Galaxy Tab 2, but the Kindle does not have the latest version of Android, and The Galaxy is more than 2 times the price.



The Good
Wi-Fi
Wi-Fi strength is excellent and there were no problems connecting to my router.  The strength is probably as good as my laptop and Wireless-N is supported, not just G.

Screen
The screen is good quality and size.  7" is about right - small book size - 10" seems a little large to me.  It is an IPS screen, just like the iPhone, and produced by LG - Korean hardware is great.  The specific aim of IPS is to support a wider field of viewing and there are various videos on You-tube that demonstrate this.

SD card
The internal 8Gb storage is treated as an SD card by applications so this device runs And Bible without requiring an SD card.

Some of the 8 Gb internal storage is used by Android so only about 5-6Gb is available.

You can add another SD card, but it is loaded as extsd, rather than sdcard, so apps like And Bible will by default save their large files to the internal SD card instead of the SD card you add.

Lessons Learned
Lesson 1 - Screen Protectors
What is the plastic on the screen.  On hindsight I think it was probably a screen protector that could have been left, but there were a few bubbles around the edge so after a struggle I took it off.  There was a free screen protector in the case but one side is sticky and if you try to clean it with the cloth cotton sticks to it and it becomes useless.

Lesson 2 - Swype Beta Will Not Install
When attempting to install Swype beta you get an 'unsupported screen size' error.  This will be fixed in the next Swype beta.

Next I tried SlideIT but this also has issues in use.  I did not try the tablet version of SlideIT because of cost.

Next was TouchPal Keyboard Tablet, which is free, and so far so good.

Lesson 3 - USB Drivers
The drivers suggested here and in several other places I tried didn't work for me.  Possibly they require Windows 7 and I use XP.

The driver referenced on this page worked.  There are also drivers here that should be tried.

Lesson 4 - Volume Down
The volume down button is laggy but this seems like a software issue rather than hardware.  Hopefully it will be addressed in a future firmware release.

Lesson 5 - Rooting
There are a couple of root scripts  for the Aurora.  There are many reports the Tasselhof does not work correctly for ICS 4.0.3.  The Almaz script may work.  I have yet to try.

Lesson 6 - Gravity Sensor/Accelerometer
This sensor is problematic and I need to add more details here after further investigation but the Aurora appears to have an accelerometer but no gravity sensor.  Also the accelerometer coordinate system is wrong by default.  To enable games like Temple run that rely on tilting the device go to Settings/Display/Accelerometer and select 'Default coordinate system'.

And Bible requires more than just the accelerometer for tilt-to-scroll, which is disabled on the Aurora.
See this review.

Summary
I like this tablet.  The screen is terrific and it makes my phone, which I loved, seem suddenly rather jaded.

Thursday 24 May 2012

Personal Reading Plans for And Bible

And Bible has a variety of reading plans which include 'Through the Bible chronologically in a year', 'M'Cheyne's plan', and several others, but people inevitably have their own custom plans.

This week I added the ability to add your own personal reading plan to And Bible and it is quite simple.  All you need to do is create a file containing readings for each day like this:

1=Gen 1, Matt 1
2=Gen 2, Matt 2
3=Gen 3, Matt 3
4=Psa 119
5=1Cor 1, Jude

and save the file to your mobile phone's SD card.

Full information on how to do this are on the And Bible wiki.