Why There’s no Update Recently?

Actually we’ve been quite busy!

With clients coming up with specific needs, our SDK development has been affected. The planned June version is now quite unlikely. But we are working on it.

The other influence is the timing of FIFA games which happens to be the hours when programmers in work most effectively. The two-day break now, though, does not suffice for us to make up the lag.

By glyafd Posted in News

20131217: New Release with Support for KitKat 4.4

Thanks to our Indian user who sent us the issue of our SDK failure after updating to KitKat 4.4, the latest Android version.
The new release resolves the specific problems proposed by him. We appreciate any suggestions and issues from our clients, who may encounter other issues due to different devices and/or diffenrent platforms.

Screen Shot 1

AnFengDe EPUB UI Component 20131021 is Released

After the last release in June, we kept receiving suggestions from developers, for which we felt the need to publish a new version. In this one the following features are enforced:

1, Support for MIPS, X86, ARMEBI, ARMEBI-V7A chip architectures;
2, Support for Android 4.3;
3, Updated and tested for iOS7 environment.

We’ve been developing UI for the new release. Indeed it has taken us quite a long time. But we think it’s worthy. Due to time and energy limitations, there’s been no optimization for the iOS7 interface. Most of the job with significance has been at the EPUB parsing layer.

Another Case of Success

We are happy to be informed by one of our Indian users who’s just released an app which has our EPUB SDK as its core for parsing book structures.
The multi-language feature, right2left and vertical rendering capabilities have been our Indian friend’s main considerations in deciding to choose our EPUB SDK.

With the ease provided by our SDK, programmers save a lot of time and can come out with an eBook reader app quickly. We anticipate more joy to be shared with us as more similar apps are developed by our users.
Images from the app’s bookshelf:

Image 1, Bookshelf

Bookshelf

Image 2, Settings
Settings Dialogue

A Success Case Using our EPUB SDK

We had yesterday an encouraging feedback from one of our SDK users who has been developing an app for Brazil’s Ministry of Education. The ministry equips public school teachers with tablets that are preinstalled of the app to introduce new technologies to these teachers. The app contains eight books. From the screenshots forwarded to us by Mr.Joao Filipe Dalla Rosa(joaofilipedallarosa@gmail.com), thanks be to him, we can see that the rendering of illustrations is quite nice, though we are Portuguese illiterate.

Screen shot 3

Screen shot of Bookshelf

Screen Shot 1

Screen Shot 1

Screen Shots

Screen Shot 2



Screen Shot s

Screen Shot 8

Screen Shot s

Screen Shot 8

AnFengDe EPUB UI Component 20130521 is released

In this release we’ve modified our project because some people want to load the inbuilt books and don’t want users to delete them. We deleted the add book function and delete book function. So if you want to add books to you project, you can put them in the books folder(in android is the assets/books), and the app will load them when it starts.

Running Unit Tests Automatically on the Emulator for Multiple Android Versions

It’s natural to write unit tests when developing Android applications, and it’s really convenient to do so in Eclipse by selecting “Run as Android Test”. Faced with testing for multiple Android versions, however, it’s troublesome because we will have to make manual selection of versions. Moreover, on the integrated test server only the command line is used. Obviously, we’ll benefit a lot if we have a script to control the versions automatically.

We first need to define an array loop:

all=(android2.2 android2.3 android3.2 android4.1 android4.2)
for i in "${all[@]}"
do
 .... run testcase and collect result....
done

There is the other issue: after starting the emulator from the command line, sometimes the command “adb” cannot detect it, causing the “adb wait-for-device” command to wait forever.   We wrote a small function to detect it, after starting the simulator, “adb devices” is called every second to scan if the word “offline” exists. If nothing is detected within one minute, then the current simulator is killed for restart.

# wait android emulator boot normally, sometime it looks booted,
# but adb cmd can not detected
function wait_emulator_boot(){
 bootok=0
 wait_time=1
 while [ $bootok -le 0 ]; do
   sleep 1
   # if detected offline status, it is boot ok
   bootok=`adb devices|grep offline|wc -l`
   (( wait_time++ ))
   # wait one minute, because more slower when version higher
   if [[ $wait_time -ge 60 ]]; then
     return
   fi
 done
 return
}

Next comes, without doubt, the emulator control by adb command and collecting test data. But there are some problems with the command adb, which, in particular, does not have return values. For example,

 adb install nobody.nobody.nobody

always returns 0. In other words, the script can’t detect if the installation succeeds or fails, an issue heaped with grumbles in Android forums.

The case with us is that the emulator already starts normally, by appearance at least, immediate executing of package installation would report:“Could not access the package manager, is the system running?”

Such error messages indicate that modules for software management are not ready yet inside the emulator. The higher the emulator version, the more serious the issue.

access_done=0
while [ $access_done -le 0 ]; do
  sleep 1
  access_done=`adb uninstall com.anfengde.epub.test|grep -v "Is the system running?"|wc -l`
done

Similarly, we keep scanning the output of error messages to see if it’s executable.

Full code is listed below so that it may be of use to you. Video clip of the running can be found at: Video Clip

#!/bin/bash
# Wirte by AFD Team, 2013.4.10
# define android version array for loop test
all=(android2.2 android2.3 android3.2 android4.1 android4.2)

# clean and build new version
ant clean
ant release

# wait android emulator boot normally, sometime it looks booted,
# but adb cmd can not detected
function wait_emulator_boot(){
  bootok=0
  wait_time=1
  while [ $bootok -le 0 ]; do
    sleep 1
    # if detected offline status, it is boot ok
    bootok=`adb devices|grep offline|wc -l`
    (( wait_time++ ))
    # wait one minute, because more slower when version higher
    if [[ $wait_time -ge 60 ]]; then
        return
    fi
  done
  return
}

# loop android version array
for i in "${all[@]}"
do
    retry=1
    running=0
    while [ $running -le 0 ]; do
        adb -s emulator-5554 emu kill
        echo "startup emulator:" $i "times:" $retry
        # run emulator in background
        emulator -avd $i &
        wait_emulator_boot

        # recheck emulator status
        running=`adb devices|grep line|wc -l`
        echo "check status:" $running "time:" `date`
    done

    # boot normally, just wait online
    adb wait-for-device

    # check software manager work not
    access_done=0
    while [ $access_done -le 0 ]; do
        sleep 1
        access_done=`adb uninstall com.anfengde.epub.test|grep -v "Is the system running?"|wc -l`
    done

    adb uninstall com.anfengde.epub.test > /dev/null
    adb install ./bin/EPUB_SDKTest.apk

    # run testcase
    adb shell am instrument -w com.anfengde.epub.test/android.test.InstrumentationTestRunner
    adb -s emulator-5554 emu kill
done

Goals of Upcoming Work

We are very grateful to the developers around the world for their recommendations and functional requirements. We ourselves also found that there are inadequacies in our work. We’ve focused on the development of functional features, neglecting the documentation part.

Two important things to do:
1, To provide a commercial AnReader program, fully open source, on which our customers can make changes to achieve their own reading software. This application will be available in Apple’s AppStore and Google Play.
2, To perfect documentation by adding implementation documents to facilitate the developers with references so as to make up for the inconvenience in concealing the core code.
After the completion of this stage, we will consider the DRM aspects of the work. As a matter of fact, the publishing industry can not just stare at contents such as novels and magazines. There are a lot of data with economic value, e.g., stock market analysis, training materials. It is entirely reasonable that respective customers set confidentiality requirement for fresh contents. As for tools for compiling EPUB books, we do not intend to develop an editor now. Rather, we will make use of existing open source tools, or provide this functionality by writing plug-ins for Office software.

Thank you, programmers, very much for your support. Please contact us when you have any questions.