Welcome to our peer-to-peer forums, where owners help owners. Need help now? Visit eSupport here.

English Community

IntroductionCommunity Spotlight
All Forum Topics
Options

1515 Posts

08-03-2011

United Kingdom of Great Britain and Northern Ireland

12135 Signins

312174 Page Views

  • Posts: 1515
  • Registered: ‎08-03-2011
  • Location: United Kingdom of Great Britain and Northern Ireland
  • Views: 312174
  • Message 1 of 2

In the Spotlight: App attack: Zoltanthegypsy's first Android app

2014-03-10, 1:41 AM

He had never done anything of this nature before, but community moderator zoltanthegypsy rose to the occasion, trying his hand at developing an Android app on a Yoga Tab 8 we sent him. He shares his experience here:

 

I recently had my first taste of Android development.  With no prior Android experience – as either a user or developer – it was pretty interesting.  The occasion was porting a toy tcl/tk application that was running in Windows, Linux, and  Apple’s OS over to the Android environment.  More about that later.  Much later…

 

The tablet:

 

YT8_and_USB_kbd_RESIZED.jpg

 

First, thanks to Lenovo for providing the Yoga Tablet 8 for this exercise.  I’m a old-school keyboard and TrackPoint using command-line c coder, so I was a pleasantly surprised by the little tablet’s capabilities.  The touchscreen is very readable and usable and the “kickstand” is a nice feature.  It’s handy to have the YT8 propped up and visible while using an external keyboard or poking at it from an attached PC.

 

YT8_and_bluetooth_kbd_RESIZED.jpg

 

Battery life is ridiculous.  In all my playing with it, I haven’t needed to recharge yet.  I can’t give you specific numbers but in my use case it looks to be at least 10+ hours.  Nice.

 

Another very useful feature is the OTG (on-the-go) micro USB port.  The provided standard micro USB cable works for charging or attaching to a PC for file transfer.  With an OTG adapter plugged in, the tablet becomes a USB host.  The OTG adapter provides a female USB connector that can be used to attach a keyboard (nice for development work) or things like my USB flash nunchucks (pictured below) for file backup and off-line transfer.

 

YT8_and_flash_drives_RESIZED.jpg

 

Bluetooth is also available.  The Lenovo compact USB and Bluetooth keyboards worked very well with the YT8.

 

Added apps:

 

A pair of apps were immediate necessities.  I’m comfortable working from the Linux command line (a Linux kernel is at the heart of the Android environment – mostly invisible to the user) so I needed a terminal emulator.  Off to the Google Play Store and grabAndroid Terminal Emulator.  It was obvious very quickly that the stock on-screen keyboard was going to be a challenge.  Arrow keys to recall and modify previous command line entries are close to mandatory.  Back to the Play Store and add Hacker’s Keyboard.  There are some really excellent free apps available via the Play store.  Who knew?

 

Hackers_keyboard_RESIZED.jpg

 

Now it’s easy to navigate the internals of the system – hunting down file paths and manipulating things not easily accessible via the stock file browser.  I’ll admit that it was often even easier yet to attach the YT8 to my desktop PC and just use Windows Explorer (yeah, I’m running Win 7 on the desktop) to navigate the tablet’s filesystem.  The tablet shows up as an attached storage device in explorer.

 

YogaTab8inExplorer.png

 

 

 

Development guides and tools:

 

To the bookstore… some browsing and guesswork led me to Ed Burnette’s Hello Android.  For me – the totally clueless – it was a good place to start.  Looks like development is usually done with an Android emulator running on a host machine.  Faster is better. See below.

 

The book said to install Java (the development kit, not just the runtime), an IDE, and the Android SDK. Things change fast in this realm so it was a little easier than that.  The JDK SE 7 development kit comes from Oracle.  Everything else can be found at the Android developer site.  The Android SDK now includes the Eclipse IDE, so that’s a plus.

 

First impression of the Android emulator:  slow.  Really, really slow.  Unusably slow.  This can be greatly improved by installing the Intel Hardware Accelerated Execution Manager (HAXM) and an x86 Atom System Image.  These allow taking advantage of the host computer’s hardware virtualization.  Thanks to this article:  Slow Android emulator, which provided some guidance. Else, I would have been stuck with this.

 

I wanted to add the Terminal Emulator and Hacker’s keyboard to the emulator.  Another thing that you real developers already know: in order for the emulation to install apps from the Google Play Store, it’s necessary to link the emulation to a Google account.  To do that, the Google APIs must be added to the Android emulation.  Use the SDK manager in the Android IDE.  Another way to do this is to browse to the app in the store and then follow the link to the individual app’s author’s site.  There’s usually a download link there.

 

T420_Eclipse_Android.jpg

 

The project.  At last:

 

This began with a desire to try some GUI programming.  In my professional life I design hardware and write Linux and Solaris device drivers and test code.  Command line stuff.  vi and BASH.  No GUI experience at all.

 

My little toy GUI project was a Sudoku solver written tcl/tk using Active’s free community edition multi-platform tcl.  It doesn’t do anything useful but was a good learning experience.  For fun it will try to solve (but not generate) Sudoku puzzles in Arabic numerals (123…) or Kanji (四, 五, 六).

 

sudoku_kanji.jpg

 

Problem is, that’s tcl/tk.  Android requires Java.  Yikes.  The conversion could take forever since I don’t know Java.  Lenovo’s Android developer forum and AndroWish to the rescue…

 

AndroWish:

 

The Lenovo forums have recently added the Lenovo Developer Community, includingAndroid Ecosystem Developers.  I posted a n00b’s request for guidance there: [Android n00b] how to begin?  No idea how such a basic request would be received.

 

I got an almost immediate reply from Christian Werner, the author and maintainer ofAndroWish.  This is a wonderful project that’s brought tcl/tk to Android.  With his encouragement – he even caught a typo in my code that had been lurking there all along – I quickly had my little toy program running in the Android emulator and on the Yoga Tab 8.  Maybe I can put off learning Java for another year or two :)

 

At this time it’s necessary to launch my little program from AndroWish’s command line.  The next phase of the project will be to convert it into an actual Android app.  Christian has provided tools and a how to:  HelloTclTk.

 

Many thanks to Christian Werner for his help, to the nice people at the comp.lang.tcl newsgroup for getting me going in the fist place, and to Lenovo for providing the Yoga Tab 8 – and a place to post and share.

 

Z.

 

..oh, almost forgot…

 

T420_and_YT8_RESIZED.jpg

 

Have experience in app development or want to know more about this from like-minded individuals? Join our app development community here!

Please remember to come back and mark the post that you feel answered your question as the solution. Did you find a post helpful? You can thank the member by awarding them a Thumbs Up! Please don't ask me questions by Personal Message; questions belong in the forums.
Using Browser Search to find your answers in Lenovo and Moto Community
Reply
Options

5 Posts

01-31-2014

Germany

5 Signins

32 Page Views

  • Posts: 5
  • Registered: ‎01-31-2014
  • Location: Germany
  • Views: 32
  • Message 2 of 2

Re: In the Spotlight: App attack: Zoltanthegypsy's first Android app

2014-04-04, 22:13 PM

Zoltan,

 

great article, and there's much more possible with Tcl/Tk on Android.

 

Make your device somewhat laugh with only three words of code:

 

   borg speak haahaahaa

 

I see, too few emotion in the voice, but hey, it is an android ;-)

 

Seriously, IMO scripting languages can help to get even complicated tasks

carried out quickly. Tcl/Tk is multi platform and now on Android.

Reply
Forum Home

Community Guidelines

Please review our Guidelines before posting.

Learn More

Check out current deals!

Go Shop
X

Save

X

Delete

X

No, I don’t want to share ideas Yes, I agree to these terms