Tuesday, 11 November 2014

App Indexing for Google Search

Websites have a lot way of getting it's content searched via search engine i.e google but mobile apps are not accessible for such search.

Smartphone users have tons of information on their phones, but the tools to find that information are rudimentary at best.

Your favorite restaurants, for example, might be stored in any number of apps, such as Foursquare or Yelp. Likewise, travel plans might be stored in an airline app or a travel app, such as Expedia or Orbitz. Finding that information requires first that you remember which app you used, since today’s search engines can’t penetrate the walls set up around each mobile application.

App Indexing allows you to connect pages from your website with specific content within your smartphone app. This enables smartphone users who have your app installed to open it directly from relevant mobile search results on Google.

Recently, a number of methods have emerged for finding information within applications. Such approaches are known as deep linking because they point not just to the right app, but to the specific place within an app’s structure where the information is stored.

App Indexing helps you drive usage of your app through Google. Deep links to your app appear in Google Search results on Android so users can get to your native mobile experience quickly and easily.

Follow this Google doc for implementing app indexing.

Apps with or without corresponding webpages can use the App Indexing API to notify Google of their deep links.

Along with Google, facebook is also providing API called App Links for app indexing.

Other companies are also providing their solutions, check below links:

http://appurl.org/
http://urx.com/

Sunday, 9 November 2014

Link your app with Google Voice Search

Google with Version 3.5 has come extended it's voice search functionality to include device apps in its search result.

Now Activate Google voice search by saying "OK Google" from anywhere within your app or from anywhere within the device.

You are only required to add few lines of code in your manifest file.

<activity android:name=".SearchableActivity">
    <intent-filter>
        <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</activity>
Once manifest changes are done, your app will receive the SEARCH_ACTION intent containing the SearchManager.QUERY extra with the search expression.

Assuming your app as MyApp. You can:
Activate Google: Say "OK Google"
Start Search: Say "search xyz on MyApp" or "Search for hotels in India on MyApp".

Inside your activity, you get the search string i.e xyz, hotels :
String query = getIntent().getExtras().getString(SearchManager.QUERY);

This feature is available on English locale Android devices running Jelly Bean and above with the Google app v3.5 or greater.

Check this OK Google from any screen and also check official post.

Saturday, 25 October 2014

Android Studio Shortcuts for Windows

Using shortcuts make a developer more productive. Eclipse provides keyboard shortcuts for the most common actions so does Android Studio. Android Studio will be official development IDE and this tutorial will help in migrating from Eclipse to Android Studio.

    1) Quick Access
Action
Android Studio Key Command
To quickly open any class
CTRL + N
To quickly open any file
CTRL + SHIFT + N
Toggle tools (maximize/minimize code window).
CTRL + SHIFT + F12
To find all places where a particular class, method or variable is used in the whole project by positioning the caret at the symbol's name or at its usage in code.
ALT + F7


    2) Editing
Action
Android Studio Key Command
Basic code completion
CTRL + SPACE
Smart code completion
CTRL + SHIFT + SPACE
Parameter Info
CTRL + P
Quick documentation
CTRL + Q
External doc
SHIFT + F1
Generate code... (Getters, Setters, constructors etc)
ALT + INSERT
Override methods
CTRL + O
Surround with… (if..else, try..catch, for, synchronized, etc.)
CTRL + ALT + T
Comment/Uncomment single line
CTRL + /
Comment/Uncomment block code
CTRL + SHIFT + /
Select successively increasing code blocks
CTRL + W
Decrease current selection to previous state
CTRL + SHIFT + W
Reformat code
ALT + CTRL + L
Optimize imports
ALT + CTRL + O
Auto indent lines
ALT + CTRL + I
Duplicate current line/selected block
CTRL + D
Delete current line
CTRL + Y
Close active editor
CTRL + F4
Highlight usage in file
CTRL + SHIFT + F7
Find usages / Find usages in file
ALT + F7/ CTRL + F7
Show usages
ALT + CTRL + F7
Rename
SHIFT + F6
Change signature
CTRL + F6
Extract method
ALT + CTRL + M
Search everywhere
Double shift
Find
CTRL + F
Find next/previous
F3/SHIFT + F3
Replace
CTRL + R
Find in path
CTRL + SHIFT + F
Replace in path
CTRL + SHIFT + R

    3) Navigation
Action
Android Studio Key Command
Go to symbol
ALT + CTRL + SHIFT + N
Next/previous editor tab
ALT + RIGHT/LEFT
Previous tool window
F12
Editor from tool window
ESC
Hide active/last active window
SHIFT + ESC
Go to line
CTRL + G
Recent file
CTRL + E
Go to declaration
CTRL + B/ CTRL + CLICK
Go to implementation
ALT + CTRL + B
Open quick definition lookup
CTRL + SHIFT + I
Go to type declaration
CTRL + SHIFT + B
Go to super-method/class
CTRL + U
Go to previous/next method
CTRL + ARROW UP/DOWN
File structure pop up
CTRL + F12
Type hierarchy
CTRL + H
Method hierarchy
CTRL + SHIFT + H
Call hierarchy
ALT + CTRL + H
Edit/View source
F4/ CTRL + ENTER
Navigation Bar
ALT + HOME
Toggle bookmark
F11
Show bookmark
SHIFT + F11
Jump to source
F4
Command look-up (autocomplete command name)
CTRL + SHIFT + A

    4) Build/Debug/Run
Action
Android Studio Key Command
Build
CTRL + F9
Build and run
SHIFT + F10
Debug
SHIFT + F9
Toggle project visibility
ALT + 1
Navigate open tabs
ALT + left-arrow; ALT + right-arrow
View recent changes
ALT + SHIFT + C
Step over
F8
Step into
F7
Smart step into
SHIFT + F7
Step out
SHIFT + F8
Resume program
F9
Toggle breakpoint
CTRL + F8
View breakpoints
CTRL + SHIFT + F8

Shortcuts on Mac OS:
The above description uses the shortcuts based on Windows and Linux. Mac OS uses the Cmd key frequently instead of the Ctrl key.

Note:                                                    
View/Edit Keymap shortcuts - File -> Settings ->  Keymap
Check this link for migrating from Eclipse to Android Studio.