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=
Related
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.
I've created a project where I want to have a list of friends returned. I'm following this tutorial and at section 2c I have realized that my build does not contain a SelectionFragment class. Where online could I download this class, or does anyone have the code for this class? Thank you.
maybe here SelectionFragment.java on github
My guess this class needed to be created a little bit earlier in tutorial.
Choose "Step 1b" link in right column of a page.
https://developers.facebook.com/docs/android/scrumptious/authenticate#step1b
It says like:"Create a new fragment class in your package for the authenticated UI. Name this class ''SelectionFragment'' and make its superclass Fragment."
In the documentation of Fragments (http://developer.android.com/guide/components/fragments.html) at the bottom of the page, we click on an item to show some informations, and we use this : Shakespeare.DIALOGUE[getShownIndex()]
Is Shakespeare a static class in the application?
Thanks
The complete source, including the Shakespeare class, is available in
SDK_HOME\samples\PLATFORM\legacy\ApiDemos\src\com\example\android\apis\Shakespeare.java
Basically it just holds strings for the purposes of demo.
Looking at it:
public static final String[] DIALOGUE =
{
"So shaken as we are, so wan with care," +
"Find we a time for frighted peace to pant," +
...
};
Yes Shakespeare is a static class in the application. in this class title and summary of Shakespeare's plays are declared so data from this class will be used in the application
Two arrays with title and dialogue are declared in the class. You can check the class on you system's drive where you have installed android setup using following path Android\android-sdk\samples\android-19\legacy\ApiDemos\src\com\example\android\apis
It refers to the Shakespeare.java in your SDK's example projects. For example in SDK 19 it is found in samples/android-19/legacy/ApiDemos/src/com/example/android/apis.
I included paypal sdk in the app and set the product name and price as shown in the attached image.
Is it possible to change the title of the paypal PaymentActivity class . ?
I used the entire code for paypal from this link
.Please suggest whether we could change the title to any text ,(I want to change the text that is marked in Red Circle)?
Jeff here from the PayPal Mobile SDK team.
The PayPal Android SDK doesn't support modifying any of the SDK activities. We don't plan to allow the ability to modify titles, as this would be an inconsistent user experience. However, we're open to feedback from users, so please feel free to file issues in GitHub if you have feature requests!
Couple observations, apparently:
The activity of off which you have put screenshot is PaymentMethodActivity (according to Hierarchy Viewer)
PayPal SDK uses ABS
According to the sample app provided in PayPal SDK page, onBuyPressed() launches PaymentActivity with startActivityForResult():
Now, according to SDK references, PaymentActivity does not provide any API for setting custom title. The page lists setTitle() as a part of "Methods inherited from class android.app.Activity", but does not give any details on how to extend PaymentActivity so that one could leverage those APIs.
So, currently, there is no way to use a custom title.
I personally would not bother to change the title on that screen as it clearly depicts itself as a PayPal screen (as one would see their homepage on a browser), but if you really want a custom title, you may need to file a new issue on their GitHub page.
Your AndroidManifest.xml file should have an entry for the PaymentActivity that looks like this:
<activity android:name="com.paypal.android.sdk.payments.PaymentActivity" />
All you should have to do is add the label attribute to that to change the title:
<activity android:name="com.paypal.android.sdk.payments.PaymentActivity" android:label="#string/some_title" />
For other potentially useful attributes, refer to the activity tag documentation.
Note: I'm assuming here that the PayPal SDK will allow you to override the title. That is, I would expect it to only set a default title if none is given explicitly.
Edit: Unfortunately, the assumption above has proven to be incorrect. Diving a little deeper, it turns out every activity in the PayPal SDK always sets its title in the onCreate() method. That's actually a little surprising, because that means that PayPal isn't leveraging Android's built-in support for localisation and resources. Although I suppose it does allow them to offer developers the SDK as a jar, which doesn't support bundling Android resources.
In any case, since the various activities haven't been declared final, you could simply try to extend them and set the title after the super has done its work:
public class TitlePaymentMethodActivity extends PaymentMethodActivity {
#Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle("Custom Title")
// or:
setTitle(R.string.custom_title);
}
}
After that, you'll have to change the manifest to point to your TitlePaymentMethodActivity, in stead of directly to the activity in the SDK. Do note that this approach may break at any point, if PayPal decides to finalize the activity classes. With that in mind, I suggest you follow #shoe rat's recommendation and file a request with PayPal for 'official' support.
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.