Posts Tagged ‘Android’
24
Feb

Awesome New Palette with loads of features and widgets

The palette in the layout editor has been completely rewritten. In the following screenshot, you can see the new palette on the left:

Some things to notice:
  • The palette now contains categories
  • The palette is an “accordion control” – it will always ensure that all category headers are visible, and you can click on a header to open that category. This will close the previously open category.
  • The widgets are shown as previews (rendered as they will appear using the current theme and screen density)
  • Note also that we now have logical icons for all the widgets, so the outline view on the right looks cleaner

More »

, , , , , , , , , , , , , , , , , , , , , ,

24
Feb
public boolean locactionServiceAvaiable() {
  LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
  List providers = lm.getProviders(true);	

  if(providers.size()>0) return true; else return false;
}

, , , , , , , , , , , ,

24
Feb

We can dynamically change between ad networks for our iPhone/Android apps and create and display custom ads to cross-promote our own apps.
This can be done using adwhirl.
What is different about adwhirl ?
Use unlimited ad networks of your choice
AdWhirl now supports iAd
Major improvements to House Ad functionality
Brand new powerful and intuitive user interface

Adwhirl maximize revenue from our iPhone/Android application Free,Transparent and Completely Open Source..!!
In adwhirl you can add your application and also we can customize our Ad networks.

Different Ad networks like Admob, BrightRoll, Google AdSense, Greystripe, iAd, InMobi, ,Jumptap etc are avalable in adwhirl.
We can also add our custom events.
Learn more about adwhirl in https://www.adwhirl.com/

, , , , , , , , , , , , ,

24
Feb

We can explore Files in a device or emulator. It is also possible to copy file from/to the device or emulator.
These are equivalent to the adb push and adb pull commands. (adb reference), but with a more user friendly GUI.
The file Explorer is a part of the DDMS perspective. It can also be made visible in the Java Developer perspective.

To open the file explorer

1. Click Window–>Show View–>Other

2. Type File Explorer in the search box.

3. Select the File Explorer under Android and click ok.

4. Now you can see this inside your java perspective.

5. With File Explorer we can copy data to and from the device.

6. Viewing of SQLite Databases in SQLite Manager is also possible.

7. Files and Folders can be deleted.(Use with Caution.. No confirmation Dialog here…)

8. The controls are located at the top-right corner of the current tab/view. (see the attached image for more info)

, , , , , , , , , , , , , , ,

24
Feb

Ever thought of simulating Calls or messages or even GPS location to your Device or emulator during development or testing of  your application?

Here is simple way of accomplishing it..

The Android ADT has a built in control for this called Emulator Control. But by default Emulator control is buried beneath the menus. To see the Emulator Control,

1. Click on the Tab Area where you want it to be placed.

2. Click Window –>Show View –>other(In the search box enter emulator)

3. Select Emulator Control and Click ok.

4. Now you can see the Emulator Control in Eclipse

5. With Emulator Control, you can

a. Simulate Incoming calls to Device/Emulator

b. Simulate Incoming sms to Device/Emulator

c. Simulate GPS Cordinates to Device/Emulator

d. You can control the Telephony access like Speed, duplex.. etc.

 

, , , , , , , , , , , , ,

23
Feb

In Android OS, we can start an application at boot time. BroadcastReaceivers are used for implementing this. They can listen for defined system or custom defined intents. They are executed when the intent is fired, even when the application is not running at the moment. You can define custom actions and fire them manually to control custom receivers, but there are several predefined broadcast within the operating system that are fired automatically on certain events.One among them is android.intent.action.BOOT_COMPLETED action. To receive this action one has to extend the Broadcastreceiver class accordingly.

A sample code snippet is Shown Below:

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.schogini.bootAPP"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".LaunchActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<receiver android:name="MyIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="3" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</manifest>

Java Coding:

package com.schogini.bootAPP;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class MyIntentReceiver extends BroadcastReceiver {
//This is called when boot completes
@Override
public void onReceive(Context context, Intent intent) {
//Set what activity should launch after boot completes
Intent startupBootIntent = new Intent(context, LaunchActivity.class);//new class to be launched
startupBootIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(startupBootIntent);
}
}

Usage Scenario:
An anti-virus/anti-malware app
A security app
Mobile Anti-theft App
Mail Client…etc

, , , , , , , , , , , , , , ,

23
Feb

You can set which type of screens your android app will support in the AndroidManifest.xml file.  Use following way to set the screen support of your apps:

 <supports-screens
        android:smallScreens="true/false"
        android:normalScreens="true/false"
        android:largeScreens="true/false"
        android:xlargeScreens="true/false"
        android:anyDensity="true/false" />

, , , , ,

22
Feb

First Download the desired Android ISO from (latest stable release is better)

http://code.google.com/p/android-x86/downloads/list

or

http://www.android-x86.org/download

Installing Android in PC — As an OS

Burn the downloaded image to CD/DVD

Insert this CD/DVD into the drive and reboot the computer

Configure the system BIOS to Boot from the CD/DVD rom

Choose to Live CD or Install the Operating System.

Warning: Instalation of Android will erase all data on your hardisk.

Installing Android in PC — Virtualbox

Create a new VirtualMachine in Virtual Box with the following configuration:

Give it a name of your choice,

select “Linux” for the operating system

and “Linux 2.6″ for the version.

When prompted for the base memory RAM size you can enter 256MB (512MB is recommended).

Snapshots:

Installed in Virtualbox & PC:



Some Useful Shortcuts for Android:

Arrows – navigation
Enter – confirm
Left Windows key – home
Escape – back
Menu or popup key (next to right Windows key) – application menu
ctrl + F1 – Console mode
ctrl + F7 – Graphical mode

USB Mouse and USB Keyboard Works without any problems for versions 2.0 (I have not tested for older releases may work as well) and above.

, , , , , , , , , , , , , , , , , , ,

22
Feb
  • Connect device to the USB.
    • Install the device drivers.(Tip: If device fails to install then Install driver Manually. Point the location of driver to <android-sdk-folder>\google-usb_driver. You should have installed the USB driver package for this)
    • Finish installing the drivers and restart adb
      • adb kill-server
      • adb start-server
  • Connect the device to wifi or lan
  • Type the following command and hit return
    adb tcpip 5555
    //5555 can be any valid port number. use non-defined ports to prevent conflicts. 5555 is default.
  • Now type the following
    adb connect 192.168.3.5:5555
    //192.168.3.5 is the IP of your device
    //to find the ip of your device do the following
    //Settings -> Wireless & Networks ->Wi-Fi Settings
    //click on the connected Wifi Connection
    //Note your IP Address: 192.168.3.5
  • adb devices
    //now you can see the list of devices connected
  • To rever back to normal USB connect the device to usb and run the following command
    adb usb

, , , , , , , , , , , , , , , ,

16
Feb

Renderscript 3D graphics engine

Renderscript is a dynamic 3D framework that provides both an API for building 3D scenes as well as a special, platform-independent shader language for maximum performance. Using Renderscript, you can accelerate graphics operations and data processing. Renderscript is an ideal way to create high-performance 3D effects for applications, wallpapers, carousels, and more.

Features of RenderScript

  • Compiled on the device
  • Uses acc compiler
  • No architectural support issues.
  • No external libraries
  • You cannot have a #include
  • No allocation allowed
  • Safe predictable

The goal of Renderscript is to bring a lower level, higher performance API to Android developers. Renderscript has been used in the creation of the new visually-rich YouTube and Books apps. It is the API used in the live wallpapers shipping with the first Honeycomb tablets. Renderscript is not intended to replace the existing high-level rendering APIs or languages on the platform. The target use is for performance-critical code segments where the needs exceed the abilities of the existing APIs. Renderscript Graphics provides a new runtime for continuously rendering scenes. This runtime sits on top of HW acceleration and uses the developers’ scripts to provide custom functionality to the controlling Dalvik code. This controlling code will send commands to it at a coarse level such as “turn the page” or “move the list”. The commands the two sides speak are determined by the scripts the developer provides. In this way it’s fully customizable.

Early examples of Renderscript graphics were the live wallpapers and 3d application launcher that shipped with Eclair and froyo. Now an A3D file created in Maya and translated to a Collada file can also be used in Renderscript. A3D is an on device file format for storing Renderscript objects.

Android – The Fountain RenderScript example

The following code produces a Fountain like animation that randomly animates points on a screen generally moving up and outwards in a fountain like way. These animations start when a users touches the screen and originate from that point.
More »

, , , , , , , , , , , , , , , , , ,