Thursday, June 27, 2019

difference between “px”, “dip”, “dp” and “sp”

  1. px
    Pixels - corresponds to actual pixels on the screen.
  2. in
    Inches - based on the physical size of the screen.
    1 Inch = 2.54 centimeters
  3. mm
    Millimeters - based on the physical size of the screen.
  4. pt
    Points - 1/72 of an inch based on the physical size of the screen.
  5. dp or dip
    Density-independent Pixels - an abstract unit that is based on the physical density of the screen. These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-pixel will change with the screen density, but not necessarily in direct proportion. Note: The compiler accepts both "dip" and "dp", though "dp" is more consistent with "sp".
  6. sp
    Scale-independent Pixels - this is like the dp unit, but it is also scaled by the user's font size preference. It is recommended you use this unit when specifying font sizes, so they will be adjusted for both the screen density and user's preference.

Tuesday, June 18, 2019

Running adb over wifi

Easy Steps for running adb over wifi

1.  Connect Android phone and host machine to same WiFi network

2.  Connect Android phone to host machine using USB cable (to start with)

3.   Run adb tcpip 5555 from a command prompt

4.   Run adb shell "ip addr show wlan0 | grep -e wlan0$ | cut -d\" \" -f 6 | cut -d/ -f 1" to obtain the phone's IP address

5.   Disconnect USB cable and run adb connect :5555

Thursday, September 20, 2018

Android Kernel

Android Kernel

The Android kernel starts in a similar way as the linux kernel.  As the kernel launches, is starts to setup cache, protected memory, scheduling and loads drivers. When the kernel finishes the system setup, it looks for “init” in the system files.

What is the difference between the linux and android kernels?, here's a list of changes/addons that the Android Project made to the Linux kernel:

  • Binder: It is an Android specific interprocess communication mechanism and remote method invocation system.
  • ashmem:  "Android Shared Memory". It is a new shared memory allocator, similar to POSIX SHM but with a different behavior and sporting a simpler file-based API.
  • pmem: "Process memory allocator": It is used to manage large (1-16+ MB) physically contigous regions of memory shared between userspace and kernel drivers.
  • logger:  This is the kernel support for the logcat command.
  • wakelocks: It is used for power management files. It holds the machine awake on a per-event basis until wakelock is released.
  • oom handling: It kills processes as available memory becomes low.
  • alarm manager: It lets user space tell the kernel when it would like to wake up.
  • RAM_CONSOLE: Allows to save kernel printk messages to a buffer in RAM, so that after a kernel panic they can be viewed in the next kernel invocation.
  • USB gadget driver for ADB
  • yaffs2 flash filesystem

Tuesday, May 10, 2011

What is the NDK?

The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.
Android applications run in the Dalvik virtual machine. The NDK allows you to implement parts of your applications using native-code languages such as C and C++. This can provide benefits to certain classes of applications, in the form of reuse of existing code and in some cases increased speed.
The NDK provides:
  • A set of tools and build files used to generate native code libraries from C and C++ sources
  • A way to embed the corresponding native libraries into an application package file (.apk) that can be deployed on Android devices
  • A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5. Applications that use native activities must be run on Android 2.3 or later.
  • Documentation, samples, and tutorials
The latest release of the NDK supports these ARM instruction sets:
  • ARMv5TE (including Thumb-1 instructions)
  • ARMv7-A (including Thumb-2 and VFPv3-D16 instructions, with optional support for NEON/VFPv3-D32 instructions)
Future releases of the NDK will also support:
  • x86 instructions (see CPU-ARCH-ABIS.HTML for more information)
ARMv5TE machine code will run on all ARM-based Android devices. ARMv7-A will run only on devices such as the Verizon Droid or Google Nexus One that have a compatible CPU. The main difference between the two instruction sets is that ARMv7-A supports hardware FPU, Thumb-2, and NEON instructions. You can target either or both of the instruction sets — ARMv5TE is the default, but switching to ARMv7-A is as easy as adding a single line to the application's Application.mk file, without needing to change anything else in the file. You can also build for both architectures at the same time and have everything stored in the final .apk. Complete information is provided in the CPU-ARCH-ABIS.HTML in the NDK package.
The NDK provides stable headers for libc (the C library), libm (the Math library), OpenGL ES (3D graphics library), the JNI interface, and other libraries, as listed in the Development Tools section.

Wednesday, February 9, 2011

Mobile

Mobile is electronic device used to connect peoples across multiple regions.

OpenGL

OpenGL a well knows platform for graphics development. To create 3d games or apps in android we have to use opengl