Create Rotary Dialer application for Android

Classically, Android users use stock dial to make calls. There are also many alternatives available on Google Play Store for stock dial. But, some users like add a touch of retro to their smartphone and seek for an old school rotary dialer.

If old guys are nostalgic about old rotary dialers, young guys sometimes doesn’t know what it is. So what is a rotary dialer ?



A rotary dialer was used on old phones to dial digits and call numbers.
Create an Android dialer with that retro touch is an interesting subject and more a good way to learn how to create a specific view on Android.

1. Images

First, we need to create some images to represent a rotary dialer.
We need the following images :
  • A background image of the rotary dialer with numbers and letters. This image must be static during rotary dialer animation.
  • A top image with the tick. This image must be also static during animation.

  • Last image will be used to be rotated during the rotary dialer animation.


 These images must be in the drawable directory of resources in your project.

2. Draw the Rotary Dialer

To draw the rotary dialer, we need to create a specific view named RotaryDialerView that must extend the class View :
public class RotaryDialerView extends View {
 
private final Drawable rotorDrawable;
 
public RotaryDialerView(Context context) {
  this(context, null);
}
 
public RotaryDialerView(Context context, AttributeSet attrs) {
  this(context, attrs, 0);
}
 
public RotaryDialerView(Context context, AttributeSet attrs, int defStyle) {
  super(context, attrs, defStyle);
  rotorDrawable = context.getResources().getDrawable(R.drawable.dialer);
}
 
@Override
protected void onDraw(Canvas canvas) {
  super.onDraw(canvas);
  canvas.save();
 
  rotorDrawable.setBounds(0, 0, rotorDrawable.getIntrinsicWidth(),
  rotorDrawable.getIntrinsicHeight());
 
  rotorDrawable.draw(canvas);
 
  canvas.restore();
 }
}
We load the dialer resource that is the only drawable with a dynamic behaviour. Here, we just display it.

The static images are displayed in the layout of the activity :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
 
  <RelativeLayout
   android:layout_width="fill_parent"
   android:layout_height="fill_parent" >
 
    <View
     android:layout_width="320dip"
     android:layout_height="320dip"
     android:layout_centerInParent="true"
     android:background="@drawable/bg" />
 
    <com.ssaurel.rotarydialer.RotaryDialerView
     android:id="@+id/rotary_dialer"
     android:layout_width="320dip"
     android:layout_height="320dip"
     android:layout_centerInParent="true" />
 
    <View
     android:layout_width="320dip"
     android:layout_height="320dip"
     android:layout_centerInParent="true"
     android:background="@drawable/top" />
  </RelativeLayout>
 
</LinearLayout>
We can know test the display and see the result :

3. Animate the Rotary Dialer

With rotary dialer displayed, we have to animate the dialer when user makes a rotate touch on the screen. How to proceed ?

We’re going to listen touch events on RotaryDialerView. Then, we must make a litte bit of trigonometry to determinate the rotation angle. Goal is to use that angle to draw the dialer with a specific rotation of that angle.

During MotionEvent.ACTION_MOVE, we set the new angle of rotation and choose to redraw the view. Note that you must add a rotation of that angle when you draw the dialer.
When MotionEvent.ACTION_UP is fired, we can get the actual position of the dialer compared to the tick and so get the number dialed. We fire that event with a specific method.

Code of RotaryDialerView is updated like this :

public class RotaryDialerView extends View {
 
  private float rotorAngle;
  private final Drawable rotorDrawable;
  private final int r1 = 50;
  private final int r2 = 160;
  private double lastFi;
 
  public RotaryDialerView(Context context) {
    this(context, null);
  }
 
  public RotaryDialerView(Context context, AttributeSet attrs) {
    this(context, attrs, 0);
  }
 
  public RotaryDialerView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    rotorDrawable = context.getResources().getDrawable(R.drawable.dialer);
  }
 
  private void fireDialListenerEvent(int number) {
    // TODO fire dial event
  }
 
  @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    int availableWidth = getRight() - getLeft();
    int availableHeight = getBottom() - getTop();
 
    int x = availableWidth / 2;
    int y = availableHeight / 2;
 
    canvas.save();
 
    rotorDrawable.setBounds(0, 0, rotorDrawable.getIntrinsicWidth(),
    rotorDrawable.getIntrinsicHeight());
 
    if (rotorAngle != 0) {
      canvas.rotate(rotorAngle, x, y);
    }
 
    rotorDrawable.draw(canvas);
 
    canvas.restore();
  }
 
  @Override
  public boolean onTouchEvent(MotionEvent event) {
    final float x0 = getWidth() / 2;
    final float y0 = getHeight() / 2;
    float x1 = event.getX();
    float y1 = event.getY();
    float x = x0 - x1;
    float y = y0 - y1;
    double r = Math.sqrt(x * x + y * y);
    double sinfi = y / r;
    double fi = Math.toDegrees(Math.asin(sinfi));
 
    if (x1 > x0 && y0 > y1) {
      fi = 180 - fi;
    } else if (x1 > x0 && y1 > y0) {
      fi = 180 - fi;
    } else if (x0 > x1 && y1 > y0) {
      fi += 360;
    }
 
    switch (event.getAction()) {
    case MotionEvent.ACTION_MOVE:
      if (r > r1 && r < r2) {
        rotorAngle += Math.abs(fi - lastFi) + 0.25f;
        rotorAngle %= 360;
        lastFi = fi;
        invalidate();
        return true;
      }
 
    case MotionEvent.ACTION_DOWN:
      rotorAngle = 0;
      lastFi = fi;
      return true;
 
    case MotionEvent.ACTION_UP:
      final float angle = rotorAngle % 360;
      int number = Math.round(angle - 20) / 30;
 
      if (number > 0) {
        if (number == 10) {
          number = 0;
        }
 
        fireDialListenerEvent(number);
      }
 
      rotorAngle = 0;
 
      post(new Runnable() {
        public void run() {
          float fromDegrees = angle;
          Animation anim = new RotateAnimation(fromDegrees, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
          anim.setInterpolator(AnimationUtils.loadInterpolator(getContext(), android.R.anim.decelerate_interpolator));
          anim.setDuration((long) (angle * 5L));
          startAnimation(anim);
        }
      });
 
      return true;
    default:
      break;
  }
 
  return super.onTouchEvent(event);
 }
}

Here, you must note the animation launched when user ends his touch on the screen. Goal is to replace the dialer to its start position with a rotate animation. The animation is defined with the standard Android android.R.anim.decelerate_interpolator .

4. Add a number area

Last step is to add a number area to display digits dialed.

We update the layout like this :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
 
  <RelativeLayout
   android:layout_width="fill_parent"
   android:layout_height="wrap_content" >
 
     <LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="66dp"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:layout_marginBottom="10dp"
      android:layout_marginLeft="10dp"
      android:layout_marginRight="10dp"
      android:layout_marginTop="10dp"
      android:orientation="horizontal" >
 
     <EditText
      android:id="@+id/digits"
      android:layout_width="0dip"
      android:layout_height="66dp"
      android:layout_weight="1"
      android:background="@drawable/btn_dial_textfield"
      android:focusableInTouchMode="false"
      android:freezesText="true"
      android:inputType="phone"
      android:maxLines="1"
      android:paddingLeft="45dip"
      android:scrollHorizontally="true"
      android:textColor="@color/dialer_button_text"
      android:textSize="28sp" />
 
     <ImageButton
      android:id="@+id/backspace"
      style="@android:style/Widget.Button.Inset"
      android:layout_width="wrap_content"
      android:layout_height="66dp"
      android:background="@drawable/btn_dial_delete"
      android:gravity="center"
      android:src="@drawable/ic_delete_phone_number" />
    </LinearLayout>
 
    <ImageView
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:layout_alignParentLeft="true"
     android:layout_alignParentTop="true"
     android:layout_marginLeft="18dp"
     android:layout_marginTop="25dp"
     android:src="@drawable/ic_dial_number" />
  </RelativeLayout>
 
  <RelativeLayout
   android:layout_width="fill_parent"
   android:layout_height="fill_parent" >
 
   <View
    android:layout_width="320dip"
    android:layout_height="320dip"
    android:layout_centerInParent="true"
    android:background="@drawable/bg" />
 
   <com.ssaurel.rotarydialer.RotaryDialerView
    android:id="@+id/rotary_dialer"
    android:layout_width="320dip"
    android:layout_height="320dip"
    android:layout_centerInParent="true" />
 
   <View
    android:layout_width="320dip"
    android:layout_height="320dip"
    android:layout_centerInParent="true"
    android:background="@drawable/top" />
  </RelativeLayout>
 
</LinearLayout>

Our Rotary Dialer application now looks like this :



5. Fire dial event

We have a number are and so we must fill it with dialed number. To make that, we must implement the fireDialListenerEvent seen previously in the class RotaryDialerView.

We define a DialListener interface with onDial(int number) method. Class interested by digits dialed should implement that class and then register to the RotaryDialerView.

We add the following code to RotaryDialerView :

public interface DialListener {
  void onDial(int number);
}
 
private final List<DialListener> dialListeners = new ArrayList<DialListener>();
 
// ...
 
public void addDialListener(DialListener listener) {
  dialListeners.add(listener);
}
 
public void removeDialListener(DialListener listener) {
  dialListeners.remove(listener);
}
 
private void fireDialListenerEvent(int number) {
  for (DialListener listener : dialListeners) {
    listener.onDial(number);
  }
}

6. Display number dialed

To display number dialed, we must register with our main activity as a DialListener to RotaryDialerView and display digit dialed :
public class RotaryDialer extends Activity {
  private EditText digits;
 
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    RotaryDialerView rotaryDialerView = (RotaryDialerView) findViewById(R.id.rotary_dialer);
    digits = (EditText) findViewById(R.id.digits);
    rotaryDialerView.addDialListener(new RotaryDialerView.DialListener() {
      public void onDial(int number) {
        digits.append(String.valueOf(number));
      }
    });
 
    ImageButton backspace = (ImageButton) findViewById(R.id.backspace);
    backspace.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
        if (digits.getText().toString().length() > 0) {
          digits.getText().delete(digits.getText().length() - 1,
          digits.getText().length());
        }
      }
    });
 
    backspace.setOnLongClickListener(new View.OnLongClickListener() {
      public boolean onLongClick(View v) {
        if (digits.getText().toString().length() > 0) {
          digits.getText().clear();
          return true;
        }
 
        return false;
      }
    });
 
    digits.setOnClickListener(new View.OnClickListener() {
      public void onClick(View v) {
        makeCall();
      }
    });
 
}
 
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_CALL) {
      makeCall();
      return true;
    }
 
    return super.onKeyDown(keyCode, event);
  }
 
  private void makeCall() {
    if (digits.getText().length() > 0) {
      String toDial = "tel:" + digits.getText().toString();
      startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(toDial)));
    }
  }
 
}
Here, we have also added the possibility to send Intent.ACTION_CALL to launch a call with the dialed number.

7. Conclusion

To conclude, you can see our Rotary Dialer application in action in that demo video :


You have noticed that it’s an extended version of our Rotary Dialer application created during this tutorial. A lot of features have been added but the core feature is exactly the same.

Now, it’s your turn to play. Don’t hesitate to create your own and add new exciting features :).

8. Extra

A live coding video to create Rotary Dialer application is also available here on Youtube :


How to change font(handwriting) in android

Today in this tutorial i'll show you how to use your own handwriting as font in android. Android is usually know for its customization and themes having your own handwriting in as a font for android will make your device unique from others it adds more personal touch to your device.

We are going to use MyScriptFont and IFont app achieve our goal.

Tip: 

If you want to add support for more characters, more languages you can use Font Painter Site (follow procedure from here :- Font Painter tutorial) and follow then continue from step 8.

Demo:


Steps :



  • Download the templete as pdf or png and print it.
  • Use a Black pen and fill that form and scan it in at anything between 300-600 dpi or open it in a paint program (or any other) to fill it out .

  • Now upload Scanned template .
  • Give a name to your font
  • Click on Start

  • Wait till it generates the output Download generated .ttf file and paste it on your SD card.
  • Now download and open iFont app

Note : 

ifont works on Rooted device only and if you want with non- Rooted device then Download HiFont
  • Click on “My Font” Tab.
  • Click on “Click this” text

  • Navigate to your .ttf file path select your .ttf file

  • Click on set. Now set your font
That's It. now enjoy your device with your own font.

Here is my result of my handwriting :v








SnackBar : A New Way of Toast in Android

Introduced with Android Lollipop, Material Design defines a complete visual language to interact with users in your applications. Amongst the best practices recommended by Google, a list of components is available. Even better, you can know when you must use these components. To display brief messages to users, you were used to create Toasts on your Android applications until now.



Toasts are good to display simple messages to users but they don’t contain actions and cannot be swiped off screen. To fill this gap, the Material Design introduces a new component named Snackar. Aimed to replace Toasts, Snackbars provide lightweight feedback about operations by displaying a brief message to users at the bottom of the screen. Furthermore, they have a big advantage compared to Toasts, they can contain an action and can be swiped off screen.

Material Design specifications define following constraints for Snackbars on Android :

  • Single-line snackbar height: 48dp
  • Multi-line snackbar height: 80dp
  • Text: Roboto Regular 14sp
  • Action button: Roboto Medium 14sp, all-caps text
  • Default background fill: #323232 100%
Fortunately, you can use Snackbar in standard on Android via the Android Design Support Library. First step is to add that library in dependency inside your build.gradle file :
compile 'com.android.support:design:23.3.0'
Next step is to add a CoordinatorLayout view in your XML layout.
Here is a CoordinatorLayout that will position itself centered at the bottom of the screen :
<android.support.design.widget.CoordinatorLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_alignParentBottom="true"
  android:layout_centerHorizontal="true"
  android:id="@+id/snackbarPosition">
</android.support.design.widget.CoordinatorLayout>
Now, to display your first Snackbar, you need to extend the AppCompatActivity in your Activity. To configure the Snackbar object, you must use the Builder design pattern. Note that the build is like the build of a Toast. In the first parameter of the make method, you must put the instance of the CoordinatorLayout you want to use.
Last parameter is used to define the duration of the Snackbar with 3 possible values : LENGTH_SHORT, LENGTH_LONG and LENGTH_INDEFINITE.

Now, let’s display your first Snackbar :

final View coordinatorLayoutView = findViewById(R.id.snackbarPosition);
 
Snackbar
  .make(coordinatorLayoutView, R.string.snackbar_text, Snackbar.LENGTH_LONG)
  .show();

Result is rather good :


Demo :



Now, you can add an action to your Snackbar and add a click listener like that :
import android.support.design.widget.Snackbar;
 
public class MainActivity extends AppCompatActivity ...
 
final View.OnClickListener clickListener = new View.OnClickListener() {
  public void onClick(View v) {
    // manage click ...
  }
};
 
final View coordinatorLayoutView = findViewById(R.id.snackbarPosition);
 
Snackbar
  .make(coordinatorLayoutView, R.string.snackbar_text, Snackbar.LENGTH_SHORT)
  .setAction(R.string.action_undo, clickListener)
  .show();
Last word to add that Snackbar support formatted texts created via Html.fromHtml() static method for example. It could be great to put in bold texts in your message.

Conclusion

Easy to use and letting you to add actions, Snackbars are great and should be used in your Android applications to replace Toasts. Don’t hesitate and adopt the Snackbars !

How to Use Java 8 with Android N

Google has unveiled developer preview of Android N last month with a new exciting developer program. Official release is planned for Q3 2016. Amongst the new features of Android N, the support of several Java 8 language features is a great addition for developers.

You should update by thisGet Android N Features without root

Supported features include :


  • Lambda expressions
  • Default and static interface methods
  • Repeatable annotations
  • Method References
  • Additionally, some new APIs introduced with Java 8 are available like reflection and language-related APIs and Utility APIs (java.util.function and java.util.stream).

Set up your development environment

To support Android N new features, you need to set up correctly your development environment. You need to get last version of Android N developer preview and to download Android Studio 2.1. You can make these installations via the Android SDK Manager on your computer. To get more details about the installation process, don’t hesitate to read the official documentation from Android Team :
http://developer.android.com/preview/setup-sdk.html

How to Use Java 8 with Android N

Enable support for Java 8

In order to use the new Java 8 language features, you need to use the new Jack toolchain. Jack, for Java Android Compiler Kit, replaces javac compiler. It compiles Java language source code into Android-readable dex bytecode with its own .jack library format.

Did you know : Google replace java with Apple's Swift Programming Language for Android

Furthermore, it provides other great toolchain features inside a single tool like repackaging, shrinking, obfuscation and multidex. Before Jack, you needed to use ProGuard to achieve these tasks for example.

To enable support for Java 8 in your Android project, you need to configure your build.gradle file like that :

android {
  ...
  defaultConfig {
  ...
    jackOptions {
      enabled true
    }
  }
 
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

Enjoy your first Lambda Expression on Android

Now, you can enjoy your first Lambda expression on Android. Basically, a Lambda expression is a block of code that can be passed around to be executed later. In fact, it is very similar to anonymous classes. However, Lambda expressions are succinct with less verbose code.

Java 8 Lambda with Android N


Let’s use a Lambda to set a click listener on a Button :
button.setOnClickListener(view -> Log.d(TAG, "Button Clicked."));
You can make the same with an item click listener on a ListView :
listView.setOnItemClickListener((parent, view, position, id) -> {
  // …
}
It works great with a Runnable interface too :
Runnable runnable = () -> Log.d(TAG, "Log from a Runnable with a Lambda");
newThread(runnable).start();
Clearly, you can see the code is shorter and more readable with Lambdas expressions. It will be great for the productivity of Android developers.

Create your first Functional Interface on Android

To create our first Functional on Android, let’s take classic example of a Calculator with an addition feature :
@FunctionalInterface
public interface Calculator {
  int calculate(int a, int b);
}
Now, you can add a default method to the Calculator interface that will be used to display a result for example :
@FunctionalInterface
public interface Calculator {
 
  int calculate(int a, int b);
 
  default void print(String result){
    // … print result …
  }
}
Finally, we can create a Lambda expression with that interface :
Calculator c = (a, b) -> a + b;
Like you can see with those simple examples, Java 8 language features will offer a new way to Android developers to improve their productivity. Thanks to the developer preview of Android N, you can try these features right now.

Google Map Java Library

Java client library for Google Maps API Web Services

Use Java? Want to geocode something? Looking for directions? Maybe matrices of directions? This library brings the Google Maps API Web Services to your server-side Java application. 



The Java Client for Google Maps Services is a Java Client library for the following Google Maps APIs:

Keep in mind that the same terms and conditions apply to usage of the APIs when they're accessed through this library.

Note:

The Java Client for Google Maps Services is for use in server applications. If you're building a mobile application, you will need to introduce a proxy server to act as intermediary between your mobile application and the Google Maps API Web Services. 
The Java Client for Google Maps Services would make an excellent choice as the basis for such a proxy server.

Downlaod Project

Support

This library is community supported. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it. We will try to support, through Stack Overflow, the public and protected surface of the library and maintain backwards compatibility in the future; however, while the library is in version 0.x, we reserve the right to make backwards-incompatible changes. If we do remove some functionality (typically because better functionality exists or if the feature proved infeasible), our intention is to deprecate and give developers a year to update their code.

If you find a bug, or have a feature suggestion, please comment below.

Requirements

  • Java 1.7 or later.
  • A Google Maps API key.

API keys

Each Google Maps Web Service requires an API key or Client ID. API keys are freely available with a Google Account at https://developers.google.com/console. To generate a server key for your project:
  • Visit https://developers.google.com/console and log in with a Google Account.
  • Select an existing project, or create a new project.
  • Click Enable an API.
  • Browse for the API, and set its status to "On". The Java Client for Google Maps Services accesses the following APIs:
  1. Directions API
  2. Distance Matrix API
  3. Elevation API
  4. Geocoding API
  5. Places API
  6. Roads API
  7. Time Zone API
  • Once you've enabled the APIs, click Credentials from the left navigation of the Developer Console.
  • In the "Public API access", click Create new Key.
  • Choose Server Key.
  • If you'd like to restrict requests to a specific IP address, do so now.
  • Click Create.
Your API key should be 40 characters long, and begin with AIza.
Important: This key should be kept secret on your server.

Installation

You can add the library to your project via Maven or Gradle.

Maven

<dependency>
    <groupId>com.google.maps</groupId>
    <artifactId>google-maps-services</artifactId>
    <version>(insert latest version)</version>
</dependency>

Gradle

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.google.maps:google-maps-services:(insert latest version)'
    ...
}
You can find the latest version at the top of this README or by searching Maven Central or Gradle, Please.

Developer Documentation

View the javadoc.

Additional documentation for the included web services is available at https://developers.google.com/maps/.

Usage

This example uses the Geocoding API.
GeoApiContext context = new GeoApiContext().setApiKey("AIza...");
GeocodingResult[] results =  GeocodingApi.geocode(context,
    "1600 Amphitheatre Parkway Mountain View, CA 94043").await();
System.out.println(results[0].formattedAddress);
For more usage examples, check out the tests.

Features

Google App Engine Support

You can use this client library on Google App Engine with a single line code change.
GeoApiContext context = new GeoApiContext(new GaeRequestHandler()).setApiKey(API_KEY);
The new GaeRequestHandler() argument to the GeoApiContext constructor tells the Java Client for Google Maps Services to utilise the apropriate calls for making HTTP requests from Google App Engine, instead of the default OkHttp based strategy.

Rate Limiting

Never sleep between requests again! By default, requests are sent at the expected rate limits for each web service, typically 10 queries per second for free users. If you want to speed up or slow down requests, you can do that too, using new GeoApiContext().setQueryRateLimit(qps).

Retry on Failure

Automatically retry when intermittent failures occur. That is, when any of the retriable 5xx errors are returned from the API.

Keys and Client IDs

Maps API for Work customers can use their client ID and secret to authenticate. Free customers can use their API key, too.

POJOs

Native objects for each of the API responses.

Asynchronous or synchronous -- you choose

All requests support synchronous or asynchronous calling style.
GeocodingApiRequest req = GeocodingApi.newRequest(context).address("Sydney");

// Synchronous
try {
    req.await();
    // Handle successful request.
} catch (Exception e) {
    // Handle error
}

req.awaitIgnoreError(); // No checked exception.

// Async
req.setCallback(new PendingResult.Callback<GeocodingResult[]>() {
  @Override
  public void onResult(GeocodingResult[] result) {
    // Handle successful request.
  }

  @Override
  public void onFailure(Throwable e) {
    // Handle error.
  }
});
Thats the joy of this library because your work is done now. Just grab API Key and play with this google map library. If you've any problem, suggestion or issue then comment below.

Demo : Animated Moving Marker on Google Map

Recently i added a post on animated moving marker on Google map with full source code. But now i am giving you demo of that source code by which you can easily find out how it feel to work.
You can be download source code from here.


How to check below demo :

Here you'll got two text field(for starting and end point) with submit button. Just add both destination and click on submit button. You got the magic.

Demo :


Review :

If you think this post is helpful then please comment below for appreciation.

What is Google's Project Soli

Project Soli is a new way of touchless interactions. It is a sensing technology that uses miniature radar to detect touchless gesture interactions. Talking about some of the devices where Project Soli can be embedded include wearables, phones, computers, cars and IoT devices. Google at the I/O 2016 also showed new concept hardware made in collaboration with LG and Harman.


Touchless Interactions

Soli is a new sensing technology that uses miniature radar to detect touchless gesture interactions.


It is a purpose-built interaction sensor that uses radar for motion tracking of the human hand.
The sensor tracks sub-millimeter motion at high speeds with great accuracy.
It is creating a ubiquitous gesture interaction language that will allow people to control devices with a simple, universal set of gestures.
It envision a future in which the human hand becomes a universal input device for interacting with technology.

The concept of Virtual Tools is key to Soli interactions: Virtual Tools are gestures that mimic familiar interactions with physical tools. This metaphor makes it easier to communicate, learn, and remember Soli interactions.

Demo


What is Virtual Tool Gestures

Imagine an invisible button between your thumb and index fingers – you can press it by tapping your fingers together. Or a Virtual Dial that you turn by rubbing thumb against index finger. Imagine grabbing and pulling a Virtual Slider in thin air. These are the kinds of interactions we are developing and imagining.

  project soli button    project soli slider

Even though these controls are virtual, the interactions feel physical and responsive.

Feedback is generated by the haptic sensation of fingers touching each other. Without the constraints of physical controls, these virtual tools can take on the fluidity and precision of our natural human hand motion.

How does it work?

Soli sensor technology works by emitting electromagnetic waves in a broad beam.

Objects within the beam scatter this energy, reflecting some portion back towards the radar antenna. Properties of the reflected signal, such as energy, time delay, and frequency shift capture rich information about the object’s characteristics and dynamics, including size, shape, orientation, material, distance, and velocity.

Radar signal visualization with Baudline
Soli tracks and recognizes dynamic gestures expressed by fine motions of the fingers and hand. In order to accomplish this with a single chip sensor, we developed a novel radar sensing paradigm with tailored hardware, software, and algorithms. Unlike traditional radar sensors, Soli does not require large bandwidth and high spatial resolution; in fact, Soli’s spatial resolution is coarser than the scale of most fine finger gestures. Instead, our fundamental sensing principles rely on motion resolution by extracting subtle changes in the received signal over time. By processing these temporal signal variations, Soli can distinguish complex finger movements and deforming hand shapes within its field.

Soli gesture recognition

The Soli software architecture consists of a generalized gesture recognition pipeline which is hardware agnostic and can work with different types of radar. The pipeline implements several stages of signal abstraction: from the raw radar data to signal transformations, core and abstract machine learning features, detection and tracking, gesture probabilities, and finally UI tools to interpret gesture controls.

Sensor data showing four gestures performed by five users
The Soli SDK enables developers to easily access and build upon our gesture recognition pipeline. The Soli libraries extract real-time signals from radar hardware, outputting signal transformations, high precision position and motion data, and gesture labels and parameters at frame rates from 100 to 10,000 frames per second.

What are the potential applications of Soli?

The Soli chip can be embedded in wearables, phones, computers, cars and IoT devices in our environment.

Soli has no moving parts, it fits onto a chip and consumes little energy. It is not affected by light conditions and it works through most materials. Just imagine the possibilities...

Whats your review ?

What you think about this cool new upcoming Google's project Soli. Please comment below.

5 Mobile Charging Myths - You should know

"Don't use your phone while it's charging," "don't leave it plugged in overnight" and "always let it die completely" — these are simply a few popular myths regarding smartphone batteries.



When it comes to battery life, there are many little rules for what you can and can't do along with your smartphone. While lots of real rules exist, there are many rumoured ones you will simply ignore. Phone batteries have evolved so much over the years, becoming smarter and easier to manage. Most lithium-ion batteries, used by major retailers like Samsung and Apple, should last between three and five years, if you take proper care of it.

Myth 1: Using off-brand chargers destroys batteries.

The truth:

Off-brand chargers, while not optimal, are fine. It's knockoffs you should avoid.


Don't go for cheap brand knockoff chargers when you can at least purchase inexpensive, off-brand chargers (as long as they're made by legitimate retailers, such as Belkin and KMS).
The results showed that off-brand chargers, though obviously not as good as the official thing, work just fine. Knockoffs barely even get the job done.

Myth 2: You shouldn't use your phone while it charges.

The truth: 

Use it all you want, as long as you're not using a sketchy third-party charger.



There are scary reasons behind this myth. People believe that using a phone while charging will make the phone explode, or electrocute the user. That actually happened to a Chinese flight attendant named Ma Ailun in July 2013, when she used her iPhone 4 while it was charging.

However, reports say it's because Ailun was using a third-party charger, not an original Apple charger.

If you're using the manufacturer-approved charger and battery, you should be fine.

Myth 3: Charging your phone overnight kills the battery.

The truth: 

Your phone is smarter than you think. Once it's fully juiced up, it knows to stop charging. That means the battery isn't even in use at all.



However, that doesn't mean you should be charging your phone all night, every night. You wouldn't fill a cup with water if it was already full, would you? Your battery life will last longer if you keep your phone charged between 40% and 80%.

Myth 4: You don't need to turn your phone off — ever.

The truth: 

Your phone may be a machine, but it still needs to take a few breaks. An Apple Genius said that in order to maximize battery life, you should turn off your phone from time to time, especially when you go to bed at night.



At the very least, Apple experts recommend turning your phone off once a week in order to preserve battery life.

Turning off your phone is important for Android devices as well. A simple reboot can help restore battery life.

Myth 5: Don't charge your phone until it's completely dead.

The truth: 

It's better to charge your phone every day than to do a "deep charge" from time to time.



Lithium-ion batteries, like the kind used in Samsung and Apple products fare better when they're charged. If you constantly let them drain to 0%, they become unstable. Your battery has a finite number of charge cycles, and every time it fully dies, that's another cycle out the window.

BONUS: Fact — heat will ruin a battery.

The truth: 

This is absolutely true. Heat and tech don't generally go hand-in-hand, and that's no different with phone batteries.

Lithium-ion batteries heat themselves, and get hotter while they're being charged. Cold weather can also have a negative impact on a phone's life, and a cold battery will die faster than usual in low temperatures.

Your phone will be safe if you keep it within its recommended temperatures; Apple says 32 degrees Fahrenheit is the lowest recommended temperature for an iPhone's environment. Samsung, on the other hand, guarantees its phones can function anywhere between -4 and 122 degrees.

Google's AI-powered Smart Messaging and Video Calling App

Get Ready for a whole new Artificial Intelligence-based Messaging and Video Calling experience.
At I/O event Wednesday, Google unveiled its new messaging app named Allo: A smart messaging app powered with machine learning programming and the company’s newly announced AI bot Google Assistant.
You just have to sign up with your phone number and link your Google account to Allo, and you are all set to go.


Today we’re sharing a preview of two new apps that take a fresh look at how people connect.

Allo, a smart messaging app

Allo is a smart messaging app that makes your conversations easier and more expressive. It’s based on your phone number, so you can get in touch with anyone in your phonebook. And with deeply integrated machine learning, Allo has smart features to keep your conversations flowing and help you get things done.

Emojis, stickers, Ink, and our Whisper Shout feature in Allo


Allo has Smart Reply built in , so you can respond to messages without typing a single word. Smart Reply learns over time and will show suggestions that are in your style. For example, it will learn whether you’re more of a “haha” vs. “lol” kind of person. The more you use Allo the more “you” the suggestions will become. Smart Reply also works with photos, providing intelligent suggestions related to the content of the photo. If your friend sends you a photo of tacos, for example, you may see Smart Reply suggestions like “yummy” or “I love tacos.”

Smart Reply suggestions in Allo


Allo also features the Google assistant, bringing the richness of Google directly into your chats—helping you find information, get things done, and have fun. You can chat one-on-one with the assistant, or call on Google in a group chat with friends. Either way, you no longer have to jump between apps to do things like book a dinner reservation with friends, get up-to-date sports scores, settle a bet, or play a game. The assistant in Allo lets you bring things like Search, Maps, YouTube and Translate to all your conversations, so that you and your friends can use Google together.
The Google assistant in Allo understands your world, so you can ask for things like your agenda for the day, details of your flight and hotel, or photos from your last trip. And since it understands natural language patterns, you can just chat like yourself and it’ll understand what you’re saying. For example, "Is my flight delayed?" will return information about your flight status.

Google assistant in Allo


Privacy and security are important in messaging, so following in the footsteps of Chrome, we created Incognito mode in Allo. Chats in Incognito mode will have end-to-end encryption and discreet notifications, and we’ll continue to add new features to this mode.

Duo, a video calling app for everyone

Duo is a simple, fast one-to-one video calling app for everyone—whether you’re on Android or iOS, a fast or slow connection, in New York or New Delhi. Like Allo, Duo is based on your phone number, allowing you to reach anyone in your phonebook. And its simple interface fades away when you’re in a call, so it’s just the two of you.

Video call in Duo

One of our favorite features of Duo is Knock Knock, which shows you a live video preview of the caller before you pick up. Knock Knock invites you into the moment, making calls feel spontaneous and fun. Once you answer, Duo seamlessly transitions you right into the call.



Duo calls are in crisp HD video (up to 720p) and audio. We’ve optimized Duo to work well even on spotty networks, so if bandwidth is limited it gracefully adjusts quality so you’re still able to connect. We also seamlessly transition calls between cellular and Wi-Fi, so you don’t need to worry about what network you’re on. Finally, we built Duo with privacy and security in mind and all calls on Duo are end-to-end encrypted.

Both Allo and Duo will be available this summer on Android and iOS. We can't wait for you to try them.

Add Android N Keyboard in Any Mobile

If you are running the N Preview 3 on your Nexus device, there is a small yet delightful change that you must check out. You can now theme the default (Google) keyboard, with unlimited options! And if You don't have Nexus device then don't worry you can also use that thing in your Non-N Devices.

Add Android N Keyboard in Any Mobile

To enter the menu, simply head to the Google Keyboard settings, and check out the menu “Theme”.

Check some geeks : Android N vs iOS 9 : An Analysis of Security

Custom themes : Add Android N Keyboard in Any Mobile


From there you will be able to pick the colors, whether or not to display the key tiles, and also pick up an image (any image!) and tweak the black overlay transparency to ensure you have just the right contrast. There are even Dark and AMOLED themes built in, a great match for Android N’s built-in Dark Mode!

Did you know : Top 10 reason Google Android going down

Amoled themes : Add Android N Keyboard in Any Mobile

Answer is Google Keyboard :

It makes typing fast and easy with gesture and voice. Glide through letters with Gesture Typing to enter words - just lift your finger to finish a word and gesture again, no spacebar required. Compose text on-the-go with Voice Typing.

Do you know about Android NSome Android N Features Got Worse

When you can’t find the right words, express yourself with hundreds of perfect emoji. Works on all your Android devices.

Download APK

Key features:

Gesture Typing: 

Slide your finger from letter to letter. Completes a word before you’ve finished the gesture, especially useful when gesturing longer words.

Voice Typing: 

Touch the microphone to simply dictate your text.
Word completion suggestions, automatic corrections, and next-word prediction based on the words you have typed.

Emoji: 

Press and hold Enter to choose from hundreds of emoji in any app (Android 4.4+).

Learns as you type: 

No need to manually add words to a personal dictionary. Type a word once and you can gesture type it or find it in suggestions next time. Long press a suggestion to remove it from your “learned words” or the keyboard dictionary.

Sync your learned words across devices to improve suggestions: 

To turn on keyboard syncing, go to Settings → Language & input → Google Keyboard → Dictionary → Sync learned words.

Gesture cursor control: 

Slide your finger across the space bar to move the cursor.

Gesture delete: 

Slide left from the delete key to quickly delete multiple words.

Symbols hints: 

Show quick hints on your keys to access symbols with a long press (enable in Google Keyboard Settings → Preferences → Long press for symbols).

One handed mode: 

On large screen phones, pin keyboard to the left or the right of the screen by long pressing on Enter and selecting the thumb icon.

Fast symbols: 

Gesture from the “?!☺” key to temporarily switch to the symbols keyboard and insert a symbol.

Fast capitalization: 

Gesture from the SHIFT key to a character to capitalize it.
Choose a layout with or without key borders to suit your style.

Gesture typing and word suggestions supported in:

English (US), Afrikaans, Armenian, Azerbaijani, Belarusian, Bulgarian, Bulgarian (BDS), Catalan, Croatian, Czech, Danish, Dutch (Belgium), Dutch (Netherlands), English (India), English (UK), Estonian, Finnish, French (Canada), French (France), French (Switzerland), Galician, Georgian, German (Germany), German (Switzerland), Greek, Hebrew, Hungarian, Icelandic, Indonesian, Italian (Italy), Italian (Switzerland), Kazakh, Kyrgyz, Latvian, Lithuanian, Macedonian, Malay, Norwegian, Persian, Polish, Portuguese (Brazil), Portuguese (Portugal), Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Slovak, Slovenian, Spanish (Latin America), Spanish (Spain), Spanish (US), Swahili, Swedish, Tagalog, Turkish, Ukrainian, Uzbek, Vietnamese.

Additional keyboard layouts:

Arabic, Basque (Spain), Bengali (Bangladesh and India)*, Esperanto, Hindi*, Kannada*, Khmer (Cambodia), Lao, Malayalam*, Marathi*, Mongolian, Nepali, Tamil (India and Singapore)*, Telugu*, Thai, Zulu.

* For Indic languages, Google also offers Google Indic Keyboard in the Play Store with Hinglish and transliteration support.