android studio generate object from selected fields - android

I'm new with android studio and just come up with a question. I've searched online, but didn't find an answer. So, does anyone know if it is possible to generate a new class, like to get a prompt where i can enter class name and other details, from selected fields in another class (something like - select fields, right click etc...)?

I dont know what are you really meaning, but if you want to create a class and gave it details, you just need to right click in the java carpet, and click in class icon.

Related

Template Proposals in Android Studio

In Eclipse, I can put my cursor on a method name and hit ctrl-space and I get a list of available template proposals.
In Android Studio, when I'm typing a method name and open paren, I get a list of template proposals, but afterwards, how do I see the list again? I've already got show quick doc on mouse move, but that only shows the method signature I selected at first. I want to see alternatives to what I selected the first time through.
How do I show alternative method signatures, aka alternative template proposals?
EDIT:
Thanks to AndroidMechanic for answering Ctrl-P.
Here is what it looks like in Android Studio:
Here is what it looks like in Eclipse: . Notice that you're presented with the documentation in Eclipse, which I find helpful. But Ctrl-P gets me most of the way there.
In android studio to see all method overloads click inside the parenthesis and hit Ctrl + P. This will show you the different combinations you could pass as parameters to a method.

Find usages of SharedPreference in AndroidStudio

Is there a way to find my usages of certain shared preferences?
You can't 'Ctrl + Click' them since they aren't methodes or variables and can't select them or use the find usages function from androidstudio.
I can use the find usages on the getBoolean() method, however this gives me every single shared preference instead of just the one i am looking for.
You can find the key of SharedPreference by just Ctrl+Shift+F or click on Edit -> Find -> Find in path .
Select the desired module where you want to search and you are good to go .
There is no special support for this in Android Studio. You need to do a regular text search for getBoolean("preferenceName".
Search for
getSharedPreferences("pref_name"
in Edit -> Find -> Find in Path...
This will display occurences where you used that specific SharedPreference.

Where can I find the source code of Android class SQLiteOpenHelper?

I want to take a look at the Android SQLiteOpenHelper class implementation, can somebody points me the location?
The link you want is:
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/database/sqlite/SQLiteOpenHelper.java
But even better let me share a great tip:
This extension for Google Chrome
https://chrome.google.com/webstore/detail/android-sdk-search/hgcbffeicehlpmgmnhnkjbjoldkfhoin?hl=en-GB adds the ad (as in Android Developer) keyword to your searchbar so you can type ad TextView and it will bring you directly to TextView on this example AND will add a link "View Source" next to the class name inside the site https://developer.android.com/reference so for any class you want to see the source it's just a click away.
You can find all the existing versions here: http://grepcode.com/search?query=SQLiteOpenHelper&n=

Android : droidar setting up POIs and show details on click

In my app i want to use augmented reality to show some predefined POIs . When user click on the POI object, i want to show more detail about that store / object.
As i was looking for free AR framework , i came across Droidar. I saw its wiki and samples and have got an idea about structure. I understood how to add POIs. I need help on making them as clickable and adding an event on click.
Please share any tutorials if you know.
Also what is the link for droidar documentations.
You could always attach a setOnClickCommand to your POI
poiObj.gObj.setOnClickCommand(new POIDisplayCommand(getActivity(), poiObj));
In the above case I have a POI object poiObj which has a GeoObj member gObj. By using the setOnClickCommand I have called a POIDisplayCommand which loads a new Activity which displays the details about the clicked POI. The POIDispplayCommand is a class that extends the commands.Command
If you need more on the above method you could always check the StaticDemoSetup.java in de.rwth.setups package of the DroidAR library in your IDE.

add item to the settings in android framework

i am working in android frameworks.i want to add an item to the existing settings in the android OS.can u plz tell me how to do this?
First read about PreferenceActivity. These group of classes handle user prefs.
Then depending on your task, do something like this.
In case you want to add a live wallpaper or an input method add android:settingsActivity in your Manifest. (Example : here)
Or follow this tutorial

Categories

Resources