Tagged: android

Olimex announced A20 Android embedded board.

Image

Olimex did it again, they will soon release a developer edition of their famous Android/Linux boards. The A20 is a dual core version running at 1Ghz and these other cool specs:

  • DDR3 memory 512MB or 1GB
  • SATA connector and power supply
  • HDMI output
  • VGA output
  • LCD connector to connect A13-LCDxxx with 4.3″ 480×272 pixels, 7″ 800×480 pixels and 10.1″ 1024×600 pixels with touch screens
  • 2x USB high speed hosts
  • USB-OTG
  • ETHERNET 100 MBit
  • 4GB NAND Flash
  • 160 GPIOs on friendly 0.1″ connectors which connects to ribbon cables
  • Audio In
  • Audio Out
  • micro SD card
  • SD/MMC card as second
  • Power managment IC with Lipo battery support, allow stand alone work and USB host working on LiPo battery power supply
  • 9 user buttons with Android functions
  • 6-16 V DC input power supply can work with any power supply adapter and automotive power 12V

The board will sell for 65 euro, with 1GB RAM and 4GB Flash, other versions are planned like a A20 SOM module.

Advertisements

Jetset on APC Rock

Thanks to Friedger Müffke (Droidcon) and APC Open Call on G+, I received an APC Rock Android board.

The Rock is one of the 3 available boards from APC, featuring Android 4.0, a VIA ARM A9 Cortex running at 800Mhz, 512MB RAM and 4GB of NAND flash. Has both output for VGA and HDMI , the latter gives a better image, 2 normal USB ports, 1 microUSB for connection to a PC, Audio out, Mic in, microSD slot (max 32GB) and an ethernet (10/100) connector.

APC Rock

The board also comes with some GPIO, SPI and I2C busses on a header but couldn’t find any API or tutorial on their site to use this, a pitty as this would make the board really cool for some electronics hacking without the need for an Arduino.

I’ve plugged the board straight into my router and had in no time internet access. You can click in the top right corner icon to visualise your IP address, which comes in handy to connect to Jetset from another device on the network.

android_ip

The board has a really fine layout, all connectors are on one site so perfect  to use  as a mini-rack-server, if I can 3D print a suitable case for it. The board conforms to the Neo-ITX standard (170x85mm) so my printer should  be able to print the case..

Biggest problem was getting my Jetset apk file on the board, since the included filemanager has no access to the internal memory, Quickly fixed by using an microSD card. Installation went well an Jetset was running on the board.

DSC_0017

DSC_0019

It ‘s also the only board I know that has direct connection for an external  power button, a standard pc power supply connector and battery backup internal clock.

Next time I’ll try to connect an Arduino onto the board, so keep an eye on this blog…

Android embedded html and java servlet engine aka JetSet Server

Recently I needed a back-end engine to drive my 3D design program I mashed-up (OpenJscad + bootstrap + backend save)  So on my Ubuntu machine I used Tomcat and with the usual spring sauce.

While this was nice an easy, I didn’t won’t to leave my laptop running  as a server, since my wife also wants to use this 3D design webapp.

Well why not using one of the Android boards available, there cheap and don’t use much power, which i can’t say from my Intel I7 ? (APC Rock, Olimex Olinuxino, Beaglebone, …)

So I remembered having written a servlet engine based upon some old 1998 opensource code I had saved on a drive.

It took me a weekend to rewrite the  core code to run it as an Android app. Ok the code isn’t the best written but it servers it’s purpose, a lightweight servlet and html engine, ready to be embedded on an Android board.

So Jetset Server was born, I tested the apk on the Olimex board I had lying around, made some config in the WIFI router, alas it took me a few hours to figure out how to put the board in the DMZ, but at the end the webserver was up and running and available on the internet from outside thanks to an no-ip dynamic domain name. The Olimex uses WIFI to connect to the router, since the installed app to sync the Androids dynamic IP address with the no-ip service connects a lot, I had to disable it to prevent locking my no-ip account.

ScreenshotJetSetEclipse

Now that the server was running I needed some simple admin webapp to configure the server, heck I needed a template engine and a UI framework. Well I quickly adopted Twitters bootstrap as the UI framework including JQuery and found a simple and effective template engine  in ‘MiniTemplator‘ for the java backend.

ScreenshotJetSetConfig_crop

Here’s an example snippet:

		<form action="admin.html" method="post">
			<fieldset>
				<legend>Configuration</legend>
				<label>Port</label> <input type="text"
					placeholder="server port number" id="port" name="port" value="${port}"> <span
					class="help-block">Port number where the server is listening
					on. Default is port 9090.</span>

				<button type="submit" class="btn">Save</button>
			</fieldset>
		</form>

Using the MVC pattern the object values are inserted in the template with the ${objectname}.

The servlet code:

package be.wodan.fhs;

import java.io.*;

import android.app.Service;
import android.content.SharedPreferences;
import be.wodan.fhs.publisher.Context;
import be.wodan.fhs.servlet.*;
import be.wodan.fhs.servlet.http.*;
import be.wodan.fhs.template.MiniTemplator;

public class AdminServlet extends HttpServlet {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8338686139653151705L;
	public static final String PREFS_NAME = "JetSetPrefs";
	private Service service;
	private Context context;

	AdminServlet(Service service, Context context) {
		this.service = service;
		this.context = context;
	}

	// / Returns a string containing information about the author, version, and
	// copyright of the servlet.
	public String getServletInfo() {
		return "admin servlet";
	}

	// / Services a single request from the client.
	// @param req the servlet request
	// @param req the servlet response
	// @exception ServletException when an exception has occurred
	public void service(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		log("admin called");
		MiniTemplator template = new MiniTemplator(context.getDocumentPath()
				+ File.separator + "admin/admin.html");
		if (req.getMethod().equalsIgnoreCase("post")) {
			log("admin post");
			String port = (String) req.getParameter("port");

			log("admin port: " + port);
			// All objects are from android.context.Context
			SharedPreferences settings = service.getSharedPreferences(
					PREFS_NAME, 0);
			SharedPreferences.Editor editor = settings.edit();
			editor.putInt("port", Integer.valueOf(port));

			// Commit the edits!
			editor.commit();
			template.setVariableOptEsc("port", String.valueOf(settings.getInt("port", 9090)));
			log("admin post end");
		} else {
			log("admin get");
			SharedPreferences settings = service.getSharedPreferences(
					PREFS_NAME, 0);
			template.setVariableOptEsc("port",
					String.valueOf(settings.getInt("port", 9090)));
			log("admin get end");

		}
		res.setStatus(HttpServletResponse.SC_OK);
		res.setContentType("text/html");
		ServletOutputStream p = res.getOutputStream();
		p.write(template.generateOutput().getBytes());
		p.flush();
		p.close();
	}

	public Service getService() {
		return service;
	}

	public void setService(Service service) {
		this.service = service;
	}

}

Future plans are:
- cleanup the code
- write a proper tutorial
- post it on github
- add a wikiservlet based upon my old wiki servlet.
- connect it to an Arduino board or IOIO for some cool stuff. 

Any suggestions or comments post a reply on this site.