How to see whats inside android classes? - java

i have been using android studio for an year now and i know what some classes do but i am just keen to know whats inside those methods in the classes. if I go di that class by pressing Ctrl+click it takes me to class but can't see what is inside the class methods.and google code search has shut down last year.where do i find core android classes?

In the Android SDK Manager you can download sources. I'm not sure how you get to the SDK manager in Studio because I use Eclipse.

From here,
Just open the Android SDK Manager and select the Sources for Android SDK of the API level you are trying to support and click Install packages.
Here is a tutorial on how to find and use SDK manager.

Related

Why can't I use "this" in my Android Studio plug-in for Unity?

I'm doing a plug-in on android studio for unity, I want to do text recognition to an image and send a string of the text detected to unity
I have the plugin in the unity project and can send and receive information normally, I want to use the google vision library, but the problem is the class TextRecognizer that I'm using, when it's built it asks for a "context", the guide says you have to use "this" but it seems that the whole plug-in structure doesn't go with it, I don't know what to do anymore
The problem description is: 'Builder(android.content.Context)' in 'com.google.android.gms.vision.text.TextRecognizer.Builder' cannot be applied to '(com.cwgtech.unity.MyPlugin)'
The name of the project comes from the youtube tutorial I was following to create the plug-in
I've followed the Android-Studio recommended action of making my plug-in class extend android.content.context, but it creates a lot of other functions on the top of my code that I don't understand, and all of them have this error: Must be one of: PackageManager.PERMISSION_GRANTED, PackageManager.PERMISSION_DENIED
The problem is that the Google Vision library requires an Android Context object in order to be used. Unfortunately, your Unity Android plugin doesn't provide an Android Context object. You can try creating an Android Context object within your plugin and passing it to the Google Vision library, but this may not work. Alternatively, you could look into using the Google Mobile Vision library which doesn't require an Android Context object.

How to use Admob in Eclipse?

I know that since Google Play Services r30 the lib folder used to add the services to Eclipse is gone. I also know that Eclipse is no longer supported by google and they support Android Studio. But can I still use the latest Google Play Services (Admob) in Eclipse and how?
Thanks!
I don't see any documentations or tutorials now about Admob in Eclipse. You need to use Android Studio now. Here is a sample tutorial. You can also check this AdMob with Firebase documentation.
The best way to use AdMob is with Firebase, but for those publishers who aren't ready to make the switch just yet, Google Mobile Ads will remain available as a standalone SDK. Android publishers can continue to import the play-services-ads Gradle artifact without using the Firebase plugin, and iOS developers can use the existing Google-Mobile-Ads-SDK CocoaPod. In both cases, the app will get the Google Mobile Ads SDK (including AdMob's ad formats and features) without Firebase.

Library to SDK in Android

I've been searching for info about it on the internet but I haven't found anything.
The point is that I want to transform my library for android, which I'm using for advertising, into an sdk to make it available for other developers.
My library is mainly an extension of the Application class and I don't know if this should be the way an sdk is made, mainly because it seems weird to me that a .jar extends the Application class.
So, I'm asking for some advices/tips/guidelines or whatever you could tell me in order to build an sdk.

Add Google API to existing eclipse project

I am writing an android app that will use Google Maps but to implement this I need the Google API. When I downloaded the android platform sdk (example android 4.0) I did not download the Google API cause did not know that I would need it to implement this feature.However, I went back and downloaded it. How do I add it to my existing project. Did some searching and all showed how to start a new project with the API but not how to add it to the existing project.
Since you have already downloaded the Google APIs for the version that you are developing for, example Android 4. all you have to do is:
Right click on your project -> Go to Properties -> Then Android - > Then select the Google APIs at API level 14
Try this simple thing. In your file which you need the google maps api which extends 'Activity', replace Activity with MapActivity. It should have a red line showing error on your code. hover mouse over it and click on the option 'Fix Project Setup'. you will then find an option that suggests you to import Google APIs. select it, and you are done.
Let me know if that works.

converting Java code to Android

I Have a Java application and I need to convert it to an Android application
is there any resources to show how ? in Android developer site I didnt found anything like that!
I need to use the Java methods and classes in android ,How it can be done?
If you use the standard android SDK (http://developer.android.com/sdk/index.html) all code is already done in JAVA and should already work in android. Just follow the instructions to set up eclipse and android sdk tools and then import your code to an android project.
The only thing that must be changed is the GUI (graphical user interface) since it's different in android. Do the "hello world" tutorial and "Hello, Views" tutorial in the android sdk page that should put you in the right track of how you should do GUI's in android ;)

Categories

Resources