Friday, 12 February 2016

Einstein's Gravitational Waves And Their Significance Explained

Leave a Comment

In one of the most anticipated press conferences ever, scientists behind the massive LIGO project announced the first ever detection of gravitational waves. 

This discovery confirms a major prediction of Einstein’s General Theory of Relativity (1915), exactly a century after they were first predicted by Albert Einstein.

Gravitational waves are ripples in space-time generated by interactions of strongly gravitating objects like black-holes. These ripples are extremely small in magnitude – so small that scientists three decades ago believed we could never detect them. And that’s what makes the discovery exhilarating – for the first time ever, we have reached a scale of experimental accuracy that is way beyond our imagination!
The GeekOnJava attempts to explain the concept of gravitational waves and the significance of the discovery.

1. What is LIGO?
The Laser Interferometer Gravitational-Wave Observatory (LIGO) is a large scale collaboration between scientists of MIT, Caltech and other institutions. Founded in 1992, the project’s main aim is to detect gravitational waves, which were believed to be undetectable. Nearly 1000 scientists worldwide are working for the project. The two detectors are located at Hanford and Livingstone, USA.


2. How are gravitational waves produced?
Gravitational waves are produced when a binary black-hole system (two black-holes rotating about each other) collapses and merges into one single black-hole, thereby releasing an enormous amount of energy in the form of ripples in space-time. This energy is estimated to be about 50 times the energy of all the stars in the universe combined!
In this case, such a black-hole merging took place about 1.3 billion years ago at a location 1.3 billion light-years away, and its gravitational waves were detected on earth at 5:51 am (US Eastern) on September 14, 2015.

3. How do the waves manifest themselves on the earth?
Gravitational waves travel at the speed of light and distort space-time on their path. The effect would be such that the length between two objects on earth would vary with time whenever a wave is passing through them. But these variations are so small, it is impossible to directly measure them even with the most accurate measuring techniques.

4. How did LIGO detect the waves?
The LIGO observatory has two arms, each 4 km long, and the entire setup is used as an interferometer. The setup has multiple mirrors which form two distinct paths for the same laser light, each along one arm.

Whenever a gravitational wave passes through earth, it compresses one arm and expands the other. This change results in an additional phase difference in the two laser paths, and hence the laser lights interfere differently in the end, causing a detectable change in the interference pattern. In short, the change in length of paths of lasers due to gravitational waves is exploited to detect the waves.

5. How accurate is the experiment?
Here comes the technological marvel. Gravitational waves cause a distortion of the order of 10¯²¹. This means, even for a 4 km long observatory, distortions would be of the order of 10-18 meters, which is about one-billionth of the size of an atom! Two decades of research and technological advancement led to an incredible amount of precision in measurements, and consequently, the undetectable was detected!

6. What is the significance of the discovery?
Firstly, let’s take a moment to pride ourselves on the unimaginable level of precision mankind has achieved. This discovery reiterates the fact that we can achieve marvels through science and technology.
Secondly, this discovery might have opened a new avenue for space exploration. Our primary tool for exploring the universe is observation through telescopes that rely only on light waves reaching us from outer space. But objects like black-hole and dark matter do not emit light and there is no easy way to detect them. However, they can interact via gravity, and gravitational waves might be the only agent which carries their information to us. Though the current technology is not adequate to make large-scale detections using gravitational waves, this might be a first step to unveiling a brand new technique of observing the unobserved part of universe. In short, it is the beginning of a new sense organ for space exploration!
Lastly, the discovery almost confirms Einstein’s General Relativity beyond doubt. This will help in developing further research in several theoretical fields such as Quantum Gravity and unification of the fundamental forces.

Good news for India!
LIGO and the Indian Initiative in Gravitational Observations (IndIGO) have proposed a collaborative project to create a world-class gravitational-wave detector in India. The project, titled LIGO-India, has been presented to the Department of Atomic Energy and the Department of Science and Technology for approval and funding, but final approval has not been granted yet. If approved, this project would mark a giant leap in India’s research in Observational Astronomy.
The GeekOnJava congratulates the scientists and staff at the LIGO collaboration for their path-breaking discovery. This is undoubtedly the most important scientific discovery since that of the Higgs Boson in 2013. Quoting France Cordova, director of the National Science Foundation, “Einstein would be beaming right now, wouldn’t he?”
Read More

Thursday, 11 February 2016

Shocking : How Windows 10 steal your data

Leave a Comment
Ever since the launch of Microsoft's newest operating system, Windows 10 is believed to be spying on its users. I wrote a number of articles to raise concern about Windows 10 privacy issues, including its controversial data mining features and privacy invasion features.

Myth:

By disabling all privacy compromising and telemetry features on Windows 10 will stop Microsoft to track your activities.

Fact: 

Even after all telemetry features disabled, Windows 10 is phoning home more than you could ever think of.

The only solution believed to cope up with these issues is to disable all the telemetry features or use an automated tool to disable all privacy-infringing features in just one click.
But unfortunately, all these efforts got wasted because Microsoft still tracks you, even after you tighten your Windows 10 privacy to an extreme level, claims the recent analysis conducted by a Voat user CheesusCrust.

Traffic Analysis Reveals Extent of Windows 10 Spying

Curious to know the extent of Windows 10 spying, CheesusCrust set up his Linux laptop with a Windows 10 Enterprise virtual machine as well as a DD-WRT router that was being utilized to monitor traffic.
CheesusCrust also disabled every single tracking and telemetry features in the operating system. He then left the machine running Windows 10 overnight in an effort to monitor the connections the OS is attempting to make.

The results are not so surprising:

Eight hours later, he found that the idle Windows 10 box had tried over 5,500 connections to 93 different IP addresses, out of which almost 4,000 were made to 51 different IP addresses belonging to Microsoft.
After leaving the machine for 30 hours, Windows 10 expanded that connection to 113 non-private IP addresses, potentially allowing hackers to intercept this data.
Taking his test to a step further, CheesusCrust again installed Windows 10 Enterprise virtual machine on his laptop, disabled all tracking features and enabled a third-party tool known as DisableWinTracking.
After this, the number was reduced to 2758 connections to 30 different IP addresses in the period of 30 hours.
The interesting fact here is: This analysis was conducted on Windows 10 Enterprise Edition that comes with the most granular level of user control, far more than the standard Windows 10 Home Edition used by a sizable audience.

The Greatest Cost to Owning 'Free' Windows 10

However, based on these logs, it would be inaccurate to say that Windows 10 is sending your personal data to Microsoft's servers. But, thousands of connection attempts in the period of 8 hours just to check for updates or adjust the time, sounds more complicated than thought.


Windows 10 does send some of your data to the company, everything is encrypted and doesn't include any of your personal details.
Terry Myerson Head of the Windows team

Here's what Microsoft says about the Windows 10 Spying concerns:
"We collect a limited amount of information to help us provide a secure and reliable experience. This includes data like an anonymous device ID, device type, and application crash data which Microsoft and our developer partners use to continuously improve application reliability. This doesn't include any of your content or files, and we take several steps to avoid collecting any information that directly identifies you, such as your name, email address or account ID."
While this research doesn't provide what details Windows 10 is sending to the company even after disabling the telemetry features, you have to keep this in mind that Nothing comes for FREE. "Free" is just a relative term. May be you are paying the greatest cost to owning Windows 10.
Read More

Tuesday, 9 February 2016

What's New in Android Studio 2.0

Leave a Comment
Android Studio 2.0 is now available in the Beta release channel with a new Android emulator along with a host of improvements that should speed up app development time.

Here's a quick rundown of what Android Studio 2.0 brings to the table:

  • Instant Run - Enables a faster code edit & app deployment cycle.
  • Android Emulator - Brand new emulator that is faster than most real devices, and includes a brand new user interface.
  • Google App Indexing Integration & Testing - Adding App Indexing into your app helps you re-engage your users. In the first preview of Android Studio 2.0 you could add indexing code stubs into your code. With the beta release you can now test and validate your URL links in your app all within the IDE.
  • Fast ADB - Installing and pushing files is now up to 5x faster using Android Studio 2.0 with an updated Android Debug Bridge (ADB) offered in platform-tools 23.1.0.
  • GPU Profiler Preview - For graphics intensive applications, you can now visually step through your OpenGL ES code to optimize your app or game
  • Integration of IntelliJ 15 - Android Studio is based on the efficient coding platform of Intellij. Check out the new features from IntelliJ here.

Android Studio 2.0 was first released as a preview on the Canary release channel back in November, and has seen steady improvements since. Its release to the Beta channel comes with some further bug fixes to the Android emulator, along with a new URL testing and validation tool for App Indexing and more.

Check out the latest installment of Android Studio Tool Time video below to watch the highlights of the features.

New Features in Android Studio 2.0 Beta

Instant Run

We first previewed Instant Run in November; this latest beta release introduces a new capability called Cold Swap

Instant Run in Android Studio 2.0 allows you to quickly make changes to your app code while your app is running on an Android device or Android Emulator. Instead of waiting for your entire app to rebuild and redeploy after each code change, Android Studio 2.0 will try to incrementally build and push only the incremental code or resource change.
Depending on the code changes you make, you can see the results of your change in under a second. By simply updating your app to use the latest Gradle plugin ( 'com.android.tools.build:gradle:2.0.0-beta2’ ), you can take advantage of this time saving features with no other modifications to your code. If your project is setup correctly with Instant Run, you will see a lightning bolt next to your Run button on the toolbar:
Instant Run Button
Behind the scenes, Android Studio 2.0 instruments your code during the first compilation and deployment of your app to your device in order to determine where to swap out code and resources. The Instant Run features updates your app on a best-effort basis and automatically uses one of the following swap methods to update your app:

  • Hot Swap - When only method implementations (including constructors) are changed, the changes are hot swapped. Your application keeps running and the new implementation is used the next time the method is called.
  • Warm Swap - When app resources are changed, the changes are warm swapped. This is similar to a hot swap, except that the current Activity is restarted. You will notice a slight flicker on the screen as the Activity restarts.
  • Cold Swap - This will quickly restart the whole application. Typically for structural code change, including changes to the class hierarchy, method signatures, static initializers, or fields. Cold Swap is available when you deploy to targets with API level 21 or above.

We made major changes to Instant Run since the first preview of Android Studio 2.0, and now the feature works with more code and resources cases. We will continue to add more code change cases to Instant Run in future releases of Android Studio. If you have any suggestions, please feel free to send us a feature request and learn more about Instant Run here.

App Indexing

Supporting app indexing is now even easier with Android Studio 2.0. App Indexing puts your app in front of users who use Google Search. It works by indexing the URL patterns you provide in your app manifest and using API calls from your app to make content within your app available to both existing and new users. Specifically, when you support URLs for your app content, your users can go directly to those links from Google Search results on their device.

    Insert App Indexing API Code into your app
  • Code Generation Introduced in Android Studio 2.0 Preview, you can right click on AndroidManifest.xml or Activity method (or go to Code → Generate…→ App Indexing API Code) to insert HTTP URL stub codes into your manifest and app code.
  • *New for Beta* URL Testing & Validation What is new in Android Studio 2.0 Beta is that you can now validate and check the results of your URLs with the built-in validation tool (Tools → Android → Google App Indexing Test). To learn more about app indexing, click here.

App Indexing Testing

App Indexing Test Results

Android Emulator


*Updated for Beta* The new and faster Android emulator also includes fixes and small enhancements for this beta release. Notably, we updated the rotation controls on the emulator toolbar and added multi-touch support to help test apps that use pinch & zoom gestures. To use the multi-touch feature, hold down the Alt key on your keyboard and right-click your mouse to center the point of reference or click & drag the left mouse button to zoom.
Pinch & Zoom Gesture with Multi-Touch

What's Next

Android Studio 2.0 is a big release, and now is good time to check out the beta release to incorporate the new features into your workflow. The beta release is near stable release quality, and should be relatively bug free. But as with any beta release, bugs may still exist, so, if you do find an issue, let us know so we can work to fix it. If you’re already using Android Studio, you can check for updates on the Beta channel from the navigation menu (Help → Check for Update [Windows/Linux] , Android Studio → Check for Updates [OS X]). When you update to beta, you will get access to the new version of Android Studio and Android Emulator.


Read More

Monday, 8 February 2016

How to Speed Up Android Studio

Leave a Comment
Google announced that they were working on Android Studio as the IDE to replace ADT. If you have just started using Android Studio or are new to Gradle, you may have noticed that any of the calls to Gradle perform very slow.

This is very noticeable while trying to build the project.  This is very discouraging. after some search over internet finally i got solutions to solve this problem and that is working for me :) Following are some ways for Android Studio and Gradle Build system to make them perform more faster.

1. Android Studio 

-Launch: Notepad++ as administrator
-Open: C:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions

There are a lot of parameters, but we are interested in memory-related parameters:
-Xms: Specifies the initial size, in bytes, of the memory allocation pool.
-Xmx: Specifies the maximum size, in bytes, of the memory allocation pool.
-XX:MaxPermSize: Size of the Permanent Generation.
-XX:ReservedCodeCacheSize: Reserved code cache size
Now, I’m using the following values:
-Xms1024m
-Xmx2048m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=512m

2. Gradle

Gradle is the new build system used in Android Studio
Now, we will configure the global settings of Gradle:

  • Goto: C:\Users\<UserName>\.gradle
    make a new file called “gradle.properties”
  • Add the following lines to the file:
    org.gradle.parallel=true
    org.gradle.daemon=true
  • Launch Android Studio and goto File -> Settings -> Gradle then enable “Offline work”
  • Restart Android Studio and check if there is any Speed Improvement

Read More

Sunday, 7 February 2016

Latest Windows 10 Have a Linux Subsystem

Leave a Comment
A Few Months Back, Microsoft impressed the world with 'Microsoft loves Linux' announcements, including, development of a custom Linux-based OS for running AzureCloud Switch and selecting Ubuntu as the operating system for its Cloud-based Big Data services.

Now, a renowned Windows Hacker and computer expert, who goes by the name ‘WalkingCat’, discovered that the latest version of Windows 10 may have a Linux subsystem secretly installed inside.

According to his tweets, hacker spotted two mysterious files, LXss.sys and LXCore.sys, in the most latest Windows 10 Redstone Build 14251, which are suspected to be part ofMicrosoft’s Project Astoria.

windows-10-linux-subsystem
Project Astoria, also known as Windows Bridge for Android, is a toolkit that allows running Android apps on Windows 10 Mobile devices.

The naming convention for latest discovered files is very similar to the Android Subsystem files from Project Astoria, i.e. ADss.sys.
So, the "LX" in these name, however, can only be taken for one thing, and that is LINUX, which suggests the Windows 10 will have access to a Linux subsystem also.

Why a Linux Subsystem?

Since Windows 10 has been introduced as a Universal Operating system for all devices, so it might be possible that Microsoft wants to expand Project Astoria from mobile devices to desktop users.

If this comes to be true, adding a Linux subsystem will be beneficial in case Microsoft has plans to offer support for Linux applications, especially servers related technology and software.

Isn't this exciting?
Read More

Saturday, 6 February 2016

Maru OS — Convert Android ROM into Debian Linux When Connected to a PC

Leave a Comment
Good News for Linux Techno Freaks! Do you usually mess with your Android smartphone by trying out the continual ins and outs of various apps and custom ROMs?


Then this news would be a perfect pick for you!

What If, you can effectively carry a Linux computer in your pocket?

Hereby introducing a new Android-based Operating system named "Maru OS" that combine the mobility of a smartphone as well as the power of a desktop on a single device.


Maru OS allows you to turn your smartphone into a desktop when plugging it with an HDMI cable.

Maru custom ROM includes two operating systems:
  • Android 5.1 Lollipop for mobile phones
  • Debian-Linux for desktop monitor
When you connect your phone (with Maru OS installed on it) via HDMI to a monitor, it will load Debian Linux automatically on your desktop screen in less than 5 seconds.
"Your phone runs independently of your desktop so you can take a call and work on your big screen at the same time," Maru OS official website explains.
Maru is shipped with Zero Bloatware (no pre-installed apps), which facilitates lots of free space for all your apps and your phone runs fast.

Advantages of Maru OS

  • Dual OS in phone
  • Multi-Tasking
  • Lightweight Distro Packages
  • Zero Bloatware, except Google Play
  • Run a web server from your pocket
  • You can set up a portable development environment
And the Best One:
If by chance… your phone get disconnected from your screen, Maru OS will preserve your desktop state in the background, helping you pick up right where you left off.
"Your hardware's capabilities are shared across your mobile device and desktop, so you don't have to context-switch around so much," reads the website.
This latest OS is still in beta stage and currently available only in Nexus 5 devices. We hope this limitation might disappear later on.
Read More

Thursday, 4 February 2016

Android ChatHead for Spotify Widget - Source Code

1 comment
This Android project provides simplistic code to produce a floating widget like Facebook's chatheads app. It is supported by Android 2.3.3+ (API 10+).

Spotify is the world's most loved music streaming app. It allows you to stream music from 25 million songs, create and share playlists, etc. Two versions of Spotify will be bundled with GoSURF:

You should read : Android Chat Head Library



Download Project

Please note that it does not provide or include any Spotify music streaming features and is essentially just the UI for demonstration purposes only. Also note that this is not a project developed/endorsed by Spotify.


Features

Assume that it's a small muted music player without any audio.

  • Tray can be dragged around the screen.
  • Tray, when released, comes back to a specific region on y-axis.
  • The tray can be tapped to open/close.
  • The widgets on the tray animate when the tray is between close and open states.
  • Next and previous music buttons change the current song and hence the album cover changes too. The change is animated.
  • Play and pause buttons work, but the change is not obvious since there is no audio.
  • Each song has a duration. After the song has played for that duration, it switches to next song which is evident from the animated change that occurs when next button is pressed. You will notice this if you stay on the first song for 30s.
  • The widget can be shut down from notification menu.
Read More

Tuesday, 2 February 2016

Creating Android Card UI

Leave a Comment
The newest version of most Android apps published by Google have started featuring "cards."  Many other popular apps are also following suit... After reading this tutorial you will be able to create cards as well.  It really is very simple.

What is a Card?

A card is nothing more than a layout or a view with a background drawable. And that drawable can be defined in XML as a layer drawable.

res/drawable/layer_card_background.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
   <item>
      <shape android:shape="rectangle">
         <solid android:color="#CABBBBBB"/>
         <corners android:radius="2dp" />
      </shape>
   </item>

   <item
      android:left="0dp"
      android:right="0dp"
      android:top="0dp"
      android:bottom="2dp">
      <shape android:shape="rectangle">
         <solid android:color="@android:color/white"/>
         <corners android:radius="2dp" />
      </shape>
   </item>
</layer-list>
The first item in the layer-list defines what will be the card's shadow.  The second item in the layer-list is the main content for the card.  You can turn any view or layout into a card by setting the background to the layer_card_background drawable.

res/layout/hello_card.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:gravity="center"
   android:background="#E0EEEE">
   <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:gravity="center"
      android:layout_margin="15dp"
      android:padding="15dp"
      android:background="@drawable/layer_card_background"
      android:text="Hello Card!\nThis is an example of a card..."/>
</LinearLayout>

Putting Cards in a List

At this point you probably realize that putting cards in a list view isn't all that difficult.  However, there are a few details that you won't want to overlook...

ListView Setup

In your listview's XML definition, you need the following attributes set:
android:divider="@null"
android:dividerHeight="10dp"
android:listSelector="@android:color/transparent" 
android:cacheColorHint="@android:color/transparent"
android:headerDividersEnabled="true"
android:footerDividersEnabled="true"

The first attribute tells the listview that you don't want a view used for the listview's divider.  The second attribute tells the listview the height of the divider.  Since we have specified @null for the divider this will be the space between each card in the list. Setting the list selector color to transparent allows us to define our own pressed state behavior for the card.  Setting the cache color hint to transparent is a good thing to do if you run into weird behaviors while scrolling.   The last two attributes will allow for margin values at the top and bottom of the list, but it will require a few changes to the listview in code as well.
After inflating the list view, and before calling setAdapter(), add empty header and footer views, like this:
m_list.addHeaderView(new View(this));
m_list.addFooterView(new View(this));

Card Item Selector Setup

If you don't want to have a pressed state for the cards in the list then you can skip this step.  Otherwise, create a new drawable file called layer_card_background_pressed.xml.  It should be a duplicate of layer_card_background.xml but the main color defined in the second item should be changed to a different color for the pressed state.

res/drawable/layer_card_background_selected.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
   <item>
      <shape android:shape="rectangle">
         <solid android:color="#CABBBBBB"/>
         <corners android:radius="2dp" />
      </shape>
   </item>

   <item
      android:left="0dp"
      android:right="0dp"
      android:top="0dp"
      android:bottom="2dp">
      <shape android:shape="rectangle">
         <solid android:color="#CCCCCC"/>
         <corners android:radius="2dp" />
      </shape>
   </item>
</layer-list>
Next you need to create a selector resource that will be used as the background for the card items.

Download Project

res/drawable/selector_card_background.xml

<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
   <item
      android:state_pressed="true"
      android:drawable="@drawable/layer_card_background_selected" />

   <item android:drawable="@drawable/layer_card_background" />
</selector>

Card Item Layout Setup

ListView items will take up the entire width of the ListView.  In general this isn't a problem but when creating a list of cards this just won't work. To get around this, you need to wrap the item with the card background in another layout that has padding values set.

Here is an example card item layout that does this:

res/layout/list_item_card.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:paddingLeft="15dp"
   android:paddingRight="15dp"
   android:descendantFocusability="beforeDescendants">

   <LinearLayout
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:paddingLeft="15dp"
      android:paddingTop="15dp"
      android:paddingBottom="15dp"
      android:paddingRight="15dp"
      android:background="@drawable/selector_card_background"
      android:descendantFocusability="afterDescendants">

      <TextView
         android:id="@+id/text1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>

      <TextView
         android:id="@+id/text2"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>

      <TextView
         android:id="@+id/text3"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
   </LinearLayout>
</FrameLayout>

Inflating the Items

Now all you have to do is get your adapter to inflate the items with the above layout. You can modify anything inside the LinearLayout... You can even change the LinearLayout to a different kind of layout if you need to.
Just don't change any of the attributes on the FrameLayout other than the padding or item clicks may not work right.

Read More

Thursday, 28 January 2016

Android Chat Head Library

Leave a Comment
Chat head is new feature which floats on screen instead of residing inside conventional application. This feature is very continent for multitasking as user can work and chat at the same time.
Like you are using calculator and someone message you on Facebook then this chat is shown over calculator like a floating bubble and you can reply to this chat by just by clicking the chat head and then resume your work after ward .

So no app switching !!!
Here i introduced Chat Head Android Library called Bubble for Android.

How to use

Configuring your project dependencies

Add the library dependency in your build.gradle file.
dependencies {
    ...
    compile 'com.txusballesteros:bubbles:1.2.1'
}

Logo

Adding your first Bubble

Compose your Bubble layout, for example using a Xml layout file. Remember that the first view of your Bubble layout has to be a BubbleLayout view.
<com.txusballesteros.bubbles.BubbleLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/avatar"
        android:layout_width="70dp"
        android:layout_height="70dp"
        android:layout_gravity="center"
        android:background="@drawable/profile_decorator"
        android:src="@drawable/profile"
        android:scaleType="centerCrop"/>

</com.txusballesteros.bubbles.BubbleLayout>

Create your BubblesManager instance.

private BubblesManager bubblesManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
     bubblesManager = new BubblesManager.Builder(this)
                                        .build();
     bubblesManager.initialize();
    ...
}

@Override
protected void onDestroy() {
    bubblesManager.recycle();
    ...
}

Attach your Bubble to the window.

BubbleLayout bubbleView = (BubbleLayout)LayoutInflater
                                    .from(MainActivity.this).inflate(R.layout.bubble_layout, null);
bubblesManager.addBubble(bubbleView, 60, 20);

Configuring your Bubbles Trash

If you want to have a trash to remove on screen bubbles, you can configure the layout of that.

Define your trash layout Xml.

<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="20dp"
    android:src="@mipmap/bubble_trash_background"
    android:layout_gravity="bottom|center_horizontal" />

Configure the trash layout with your BubblesManager builder.

private BubblesManager bubblesManager;

@Override
protected void onCreate(Bundle savedInstanceState) {
     bubblesManager = new BubblesManager.Builder(this)
                                        .setTrashLayout(R.layout.bubble_trash_layout)
                                        .build();
     bubblesManager.initialize();
    ...
}


Thats it. Hope it helpful isn't it. Please give me some second by your comment.


Read More

Wednesday, 27 January 2016

Google Now Tips & Tricks You Should Know

Leave a Comment
Apple have Siri, Microsoft have Cortana and Google have Google Now. Which one is better is a discussion that never ends. After using all of them I personally think that Google Now is slightly better than the competition. And just to be clear, I’m not saying this because I’m an Android fanboy. My opinion is completely impartial.

Google Now, that started as a way to simply search Google, has evolved a lot over the years and has become much more than just a way to look stuff up. It is a full fledged personal voice assistant now. Being accessible from any screen adds another level in its functionality.

Setting Up Google Now

now-setup
Before diving into the voice commands it is important that Google Now is setup according to your tastes and preferences. If you’ve already set it up you deserve a high five. But if you haven’t, here’s you to do it:
  1. Open Google app and sign in using your Google account
  2. Done signing up? Great. Now tap on the hamburger menu on the top left corner of the screen.
  3. Tap on “Settings” to manage stuffs like accounts & privacy, search language, etc. Make sure to enable voice detection from any screen by going to Voice > “OK Google” detection > From any screen > turn on the toggle.
  4. Go to “Customize” to set your preferences
  5. Once everything is done you’ll start to see relevant information in the form of Now Cards
  6. Saying “Okay Google” from any screen will activate Google Now
Once you get used to Google Now it’ll become difficult not to use it everyday. Here are 10 Google Now voice commands to get the most out of this amazing service.

1. Do Calculations & Conversions

1
Everyone is not a mathematics wizard. Getting the calculations done without thinking too hard is a quite amazing feeling.
Google Now can do your calculations for you. First of all say “Okay Google” to fire up Google Now. Once it is listening say “add 678548 with 224689”. You’ll get the answer in a second or two. You can use Google Now for other calculations like subtraction, division, or multiplication. Say ” 17 % of 4578″, it can do that too.
Google Now is also useful when it comes to conversions. Say “Convert 46.5 kilometres in meter”, you’ll get the accurate answer.
You can also use it for calculating tip or finding out square root.

2. Check The Weather

2
If you want to know how the weather is going to be at your place or any other place, Google Now can do that too. Just ask ” What’s the weather like? “ to know weather condition of your current location. “Will it rain today?” or “Will I need an umbrella tomorrow?” would also do the trick.
If you want to know what’s the weather like in some other place simply ask “What’s the weather like in New York?”. Replace New York with the place of your liking.

3. Set Alarms & Timers

3
Google Now can set alarms and timers too. Just say ” OK Google “ to launch Google Now, then say “Set a timer for 20 minutes” and it will notify you after 20 minutes.
To set alarms, say “Wake me up at 5:45 AM”. It will set an alarm for the mentioned time.

4. Define Words

4
I use this one quite often. If you are confused what is the meaning of a word just ask Google Now. Simply say ” What is the meaning of uncanny?” or say “Define uncanny”. Google Now will tell you what that word means.

5. Create Events & Reminders

5
Creating Events & Reminders with Google Now is as simple as playing Angry Birds.
Just say ” Set a meeting with John Doe at 3:45 PM” or “Remind me to buy coffee when I’m near City Centre”.

6. Do Translations

6
Almost everything can be done by using amazing Google services. You can even translate a sentence in another language. A trick like this will prove useful when you are in a different place and don’t understand the language.
Just say ” How to say excuse me in French?”.

7. Call, Text, And Send Email

7
Google Now can do this too. There is no need to touch your phone now.
Just say “Call John Doe” to call John Doe. If there are multiple numbers for a person, it’ll will ask you which number to call.
Say “Text John Doe” to text John Doe. Next, you’ll have to dictate the content of the text, and then say “Send” to send the text.
Say “Send an email to John Doe” to send an email.

8. Check The Distance

8
Google Now can tell you the distance between two points i.e. point A and point B. For example, say “What’s the distance between New York and New Jersy?”. Once you get the distance, say ” Show me the route “ or “Give me directions” to get directions.

9. Ask Questions

9
Google Now can give you an answer for any question. Ask “Who is the author of A song of ice and fire?” or “How long the Inception is?” or “What’s the population of India?”. It can also answer follow up questions. For example, ask ” Who played Ted on How I Met Your Mother?” and it’ll say Josh Radnor. Now ask “How old is he?” and Google Now remember that you are talking about Josh Radnor.

10. Have Fun

10
You can also use Google Now to have some fun. Here are some of the voice commands:
  • Make me a sandwich
  • Do a barrel roll
  • Tell me a joke
  • What does the fox say?
  • When am I?
  • Beam me up Scotty
  • Who are you?
  • Askew
Read More