Embedded Android FAQs

From DAVE Developer's Wiki
Jump to: navigation, search
Info Box
Android-logo.jpg Applies to Android

Introduction[edit | edit source]

As known, Android is conceived to address mobile devices such as smartphones and tablets. Nevertheless, it is gaining popularity in the industrial applications as well. The main reason is the availability of a well-known cross-platform software interface/environment for the development and the execution of application layer programs (the apps). Even though there is no doubt about the fact that this is an appealing feature, it is worth remembering that Android is not designed to be portable to embedded devices which are not compliant with the Android Compatibility Definition Document. Generally speaking, the embedded platforms used to build devices for the industrial/telecom/biomedical markets do not comply with these requirements because the presence of interfaces which are not used in the mobile devices.

Therefore, adapting Android to such embedded platforms is a hard time-consuming process, taken into account the complexity of the Android Open Source Project (at the time of this writing, it consists of about 50 GByte of source files). DAVE Embedded Systems is able to perform such task as proven by several success cases in the industrial and building automation applications.

This document provides a list of FAQs about the use of the Android stack on such devices.

FAQs[edit | edit source]

Q: How to get the hardware serial number? (NXP i.MX6-based systems only)[edit | edit source]

The hardware serial number (as defined here) can be programmatically accessed as described in this page.

It is worth to remember that the hardware serial number is stored in this pseudo file: /proc/device-tree/som/uniqueid.

Q: How to get the network interfaces' MAC address?[edit | edit source]

The network interfaces' MAC address is stored in this pseudo file: /sys/class/net/<net_if>/address

e.g.: for the primary ethernet interface eth0 the MAC address is stored in the file /sys/class/net/eth0/address

For more details, please see this page.

Q: Why am I getting socket: Permission denied when I run ping as root?[edit | edit source]

Android kernels by default uses CONFIG_ANDROID_PARANOID_NETWORK configuration, to enable Internet permission check with its API. This requires that all process that want to access network resources belongs to specific hardcoded GID

First of all you need to add those special GID to you root file system:

groupadd -g 3001 aid_bt
groupadd -g 3002 aid_bt_net
groupadd -g 3003 aid_inet
groupadd -g 3004 aid_net_raw
groupadd -g 3005 aid_admin

And then add root (or the user you want to allow to access network resources) to those group, e.g.:

usermod -a -G aid_bt,aid_bt_net,aid_inet,aid_net_raw,aid_admin root

Please note that you have to logout and login again to apply group membership.

Reference: https://stackoverflow.com/questions/36451444/what-can-cause-a-socket-permission-denied-error