Friday, 21 February 2014

Android in layman point [ Android Architecture ]


The Android platform
  • Android platform is software stack
  • Supports mobile and tablet
  • It has many layers to support application to run.

The android architecture
  1. Application layer
  2. Application framework
  3. Libraries and DVM
  4. Linux kernel (provides generic OS services)

Linux kernel proves following services

  1. Security
  2. Memory & process management,
  3. File & network IO
  4. Device drivers to communicate with varies hardware
  5. Common OS services.

Android Linux kernel provides extra service other than Linux 
  1. Power management
  2. Android shared memory(ashm)
  3. Low memory killer
  4. Inter process communication (binder)

Libraries
  1. System C libraries System libraries written in C/C++ native Libraries
    • Bionic Libc
  2. Surface manager
    • Display management
  3. Media Framework
    • Audio/Video
  4. Webkit
    • Browser engine
  5. Open GL
    • Graphics Engines
  6. SQLite
    • Relation Database Engine

Android Runtime
  • Support writing and running android applications
  • Two components in android run time

Core Java Libraries


  • Android application written in Java programming language
  • Set of standard functionality are provided by library to write application.
    •  Basic Java classes – java.* javax.* (data structure, Ux, Concurrency, FILE IO)
    •  App Lifecycle – Android.*
    • Internet/Web service – ORG.Unit Testing – Junit.*

 Dalvik Virtual Machine

  • Software executes android application.
  • Android application written in JAVA which needs JAVA virtual machine to execute.
  • But Java virtual machine is too heavy to run on mobile platform it is made for Desktop
  •  So Android provides the optimized version of Java Virtual machine which runs on Mobile
   Typical Workflow of App Development
  1. Write application in java program (file.java)
  2. Java compiler compiles file.java to Java byte code files (file.class)
  3. Dx converts the Byte code files (file.class) to single dex byte code file (classes.dex)
  4. Dalvix executes the DEX byte code file to machine language 

Resource Constrained Environments
  • Slower CPU
  • Less RAM
  • Limited Battery Life

Application Framework

Package manager

-          Maintain the data base of all the installed applications

Window Manager

-          Manages many windows
-    System Notification
-    Main application window
-    Application Sub window

View System

-          Provides command user interface
-    Icons buttons, text box, label

Resource manager

-          Non compiled resources
-    Strings, graphics, layout files

Activity manager

-          Manages app life cycle and navigation support

Content Provider

-          Inter application data sharing.

Location Manager

-          Provides location and movement information

Notification Manager

-          Place information in notification bar (e.g. SMS, Missed Call, batter charging info)

Application Layer
  • Application like phone , contacts, launcher, SMS
Check out the next blog for setting up your android development environment...




Tuesday, 4 February 2014

Setting up the torrent client on Ubuntu/Raspberry pi

In this post, I will show you how to setup transmission torrent client in your Ubuntu/Raspberry pi

What is Bittorrent?

BitTorrent is a protocol used for peer-to-peer file sharing that is used to distribute large amount of data over the internet. It means that the torrent client can download the data from the nearest peer instead of getting the data from a single source server. It can be used to reduce the server and network impact of distributing large files. It can work over networks with lower bandwidth.


Execute the below comments

 Install transmission torrent client

$> sudo apt-get update
$> sudo apt-get install transmission-daemon -y

 

After successful installation stop the transmission-daemon 


$>  sudo service transmission-daemon stop


  
Configure the torrent client by modifyint the settings.json file

$> sudo vim /etc/transmission-daemon/settings.json


  

Modify the below value in the settings.json file

            => "rpc-authentication-required": false
            => "rpc-whitelist": "127.0.0.1, 192.168.0.*"
            => "rpc-port": 9091
            => "rpc-url": "/transmission/"

  



 Start the transmission-daemon.

$> sudo service transmission-daemon start





Open the web browser type the below URL

<Your Machine IP>:9091/transmission/web/
Eg. 192.168.0.20:9091/transmission/web/


  


Upload the torrent file or URL to download torrent content

Friday, 24 January 2014

Enable ssh server on Ubuntu

In this post, I will show you how to install and enable ssh on Ubuntu

What is the use of SSH?

Let consider your Ubuntu machine is connected to your home WiFi router. Now you want to access the Ubuntu terminal in your Windows machine which is also connected to WiFi router.

By default in Ubuntu SSH server is not installed. So you have to install the openssh package. Once you install the openssh package it automatically enables the ssh server on your Ubuntu machine.

Execute the below comments


Install the openssh package

$ sudo apt-get install openssh-server -y


 

After successful installation restart the ssh service 


$ sudo /etc/init.d/ssh restart




If you want to change the default settings, such as the default port. edit the /etc/ssh/sshd_config file:

$ sudo vim /etc/sshsshd_config




To check the ssh, go to your windows machine run putty.exe


Connect to your Ubuntu machine through ssh.

Sunday, 22 September 2013

Know More About Raspberry pi




What is the Raspberry Pi?

Raspberry Pi is a small computer with the components mounted on a credit card sized motherboard, running a dedicated version of Linux.Capable of offering basic office computing, low-level gaming, Internet and email access, media playback and many other features regularly expected from a computer in the 21st century, the Pi achieves all of this with a stripped-down component count, an ARM processor and a very low price. Costs are kept so low by selling the computer without cables, storage or a case.
         




Alternatives to Raspberry pi

  • BeagleBone Black : The BeagleBoard is a low-power open-source hardware single-board computer designed with open source software. It came late to the market compare to raspberry pi. But it is more powerful than raspberry pi.
  • ODROID: a slightly bulkier computer with the same processor as a Samsung Galaxy S3 smartphone. This runs Android and Ubuntu operating systems.
  • Gooseberry: currently unavailable, this device runs Android and is a little larger than the Raspberry Pi

Look at inside the Raspberry pi

For such a small device you would probably except the spec of the Pi to be low  But this device isn't to stripped back that you won't be able to gain some use from it.

It has a ARM processor which clocks at speed of 700MHz with 512MB RAM more than enough to run embedded software. USB, Ethernet, HDMI, RCA and 3.5mm audio ports.

It has two version Model A and Model B. Model B is a updated version of the initial raspberry pi (Model A) with more RAM size and USB ports.

Some components, such as storage, are left to the Pi’s buyer to deal with. Cables and even the device’s case are not included when you purchase one of these devices new.
 



See the full spec of the raspberry pi

Some useful application of Raspberry pi

  • Plug & Play Computer
  • Small personal web server
  • Media play center(XMBS)
  • Home Security System
  • Personal Cloud Storage.
  • Surveillance web camera
Actuall the possibility is endless. People making raspberry pi as most powerful application oriented devices.

Check out the Some of awesome  Raspberry pi projects.