Android Gesture recognition - android

What algorithm is used in Android Gesture recognition?Can I get the source code anywhere?
I will be using android gestures recognition feature and I need to know what are the basic requirements or criteria for Gesture recognition?How does it predict a score against matching gestures?Does it depend on number of gesture strokes?? or the size of gesture strokes?

Try checking the Android Api Source code

Is this what you're looking for? https://android.googlesource.com/platform/frameworks/base/+/master/services/java/com/android/server/accessibility/TouchExplorer.java

You can use IBM Wearables SDK for Android
it allows you to record gestures and then recognise them in your app
for more info:
https://github.com/ibm-wearables-sdk-for-mobile/ibm-wearables-android-sdk

I can't tell you how exactly it works since I haven't tried understanding the code and not sure if I'm capable at my current skill level. But to get the code in androidStudio (don't know if you are using that but maybe it's similar in other software?).
Create a GestureDetector:
private GestureDetector mDetector;
Select the GestureDetector, right click and goto Declaration (CTRL+B).
It takes you to the code. Inside that code you can also select methods and right click go to their declaration.
If it shows you that you don't have the code, I think something pops up to install it. If not you can install it like this:
Tools -> Android -> SDK Manager. In the tab SDK Platforms click on show package details below. Select sources you want to install. You can install sources for multiple versions so you can also check code of older versions if you'd want to.
You can also directly check the files on your computer, the path is something like this for example (if on windows):
C:\Users\yourUserName\AppData\Local\Android\Sdk\sources\android-22\android\view <-here is for example view code for android api level 22

Related

Samples are currently unavailable for: {Symbol: Fragment, Package: android.support.v4.app} in android studio

From Android studio 2.2 Preview, Google-provided Android code samples based on the currently highlighted symbol in your project. To use the feature, highlight a Variables, Types and Methods in your code then Right Click to show a context menu for Find Sample Code.
[http://android-developers.blogspot.in/2016/05/android-studio-22-preview-new-ui.html][1]
When I tried this future I am getting Samples are currently unavailable for Fragment,AppCompatActivity,Toolbar, FloatingActionButton.
Do we need to download samples or enable it from settings, how can I get this future ?
You need to download samples from the SDK Manager.
Check the following link for reference.
http://www.tutorialspoint.com/android/android_sdk_manager.htm

Can I use Android Studio's 'Find Useage' for Android SDK Source Code?

One of the most useful functions in AS is right-click and 'Find Useage' or 'See Declaration'. For my code, the 'Find Useage' will show all instances of where a function/object is used.
I have the SDK source code in AS too, but I can't 'Find Useage' on that code. Is there a way to set up my projects so that I can use 'Find Useage' on Android SDK code? For example, I would like to go to android/platform /frameworks/.../Configuration.java, right click on Configuration, and see where that class is being used elsewhere.
Failing that, is there a way to find useages short of grepping around the massive SDK project?
Yes, that is possible. You can configure the scope of the search function.
Move the cursor on the symbol you want to analyse, press Ctrl+Shift+a (search for action) and search for Find Usage Setting or from the menu select Edit -> Find -> Find Usage Setting and select Project and Libraries in the scope section.
If the menu item is grayed out, it's because no symbol has been selected.
Furthermore, if you are looking for a particular feature in AS the search for action function is a huge time saver.
BTW: If Project and Libraries is not available it's because there is no usage of the selected symbol in any library.
May be you are looking for this:
Edit->Find->Find in path...
If you are using Android Platforms Codebase directly from the repo, then you can do it. In this case, you will have to update your dependencies by creating another gradle project in your studio where the platform codebase is and then import that in your project.

Whatever happened to Google Android samples linked in their tutorials?

I seem not to be able to find any of the Google Android samples. For example, I'm reading this: https://developer.android.com/guide/topics/graphics/prop-animation.html#keyframes, and there is a link to a MultiPropertyAnimation sample which should show how to use keyframes. When I click there, it get redirected to a samples main page, and the sample I'm looking for is not there, or at least I can't find it. The same for quit a few other samples. I also tried importing the samples in Android Studio, which provides a search/filtering interface, and can't find anything there.
Has Google moved the samples, and forgotten to update the rest of the docs? Did the 'old' samples get deprecated and moved elsewhere? Can they still be accessed?
The latest (and most convenient way) to do it is:
open android studio
if a project is currently opened, close it (file -> close project)
on the following screen choose "Import an Android code sample".
Also see http://developer.android.com/samples/index.html

How to open android documentation and samples of code in android studio

I have downloaded all documentation with SDK manager help. But how can I open this documentation and the samples of code in Android Studio after downloading?
According to Android Studio Tips and Tricks, you can press Ctrl+Q to show docs for selected API under Windows or F1 under Mac.
For the samples , you can use eclipse to export to Android Studio.
First you need to make sure the documentation is added to Android Studio.
Go to File -> Project Structure. Under the Platform Settings heading, add or select an Android Platform. Go to the Documentation Paths tab and make sure the path to your SDK's documenation folder is added there - it should be [SDK]\docs\reference, where [SDK] is the full path to your SDK installation. If it is not there add it manually.
Once this is done, use Ctrl+F1 while your cursor is on the item you want to display help for.
The samples have not been ported to Android Studio yet, but I'm sure google will get around to it at some point. For now follow the instructions in the comments by androidika (you will need a copy of Eclipse installed).
In Android Studio you need to download javadoc dependency which is part of sdk.
If you enable documentation to appear while writing code in android studio by navigating to
File-> Settings-> Editor-> General-> Other
and
selecting(check box) Show Quick documentation on mouse move, you would get irritating after some time because it will come out automatically you when you would be writing code.
So, I think we should go to alternative ways by using Ctrl + Q(on Ubuntu at least I am not sure of other environments). This way when you would feel help you can simply use the simple command.
I was trying to find this setting in the latest build of android studio, and after wasting a lot of time I finally found out that now the ide automatically finds the documentation, which can be opened with shift+f1 on a method.
Now a days once you Import project in Android studio, it will automatically shows docs. But on mouse hover you want to expand it.
Docs hover page was simply resized very short like the above, it looks like docs is not avail. But when I Carefully moving the mouse down to the bottom of the hover page allowed me to resize it.

Is this a built in drawable?

In this linked image , I see the button on the right quite often in a lot of apps. On my Moto Droid, it is used extensively in the settings app. It is also used as the default AlertDialog icon. Can I use this via a android.r.drawable?
The icon is built-in with the Android development, you can access the image by using R.drawable.ic_dialog_menu_generic
While it may be possible to use it via android.R.drawable, you may want to find the image in the resources that come with your SDK ($ANDROID_HOME/platforms/$VERSION/data/res, where $ANDROID_HOME is where you have the SDK installed and $VERSION is a relevant Android API level). So, per Mr. Forloney's answer, you'll find that in, say, drawable-hdpi/ic_dialog_menu_generic.png in the aforementioned directory. Then, copy that image into your project. While it will add 5K to your project size, it will mean that the icon does not change based upon OEM or Android changes.

Categories

Resources