How to import APIDEMOS into my project - android

I am using eclipse helios.I am importing android samples.But when I am importing project it is showing message that no project is selected.Any idea.

Lazy copypasta at OP's request:
You need to import the demos into a specific project.

Related

Importing a sample from an already imported library in android

In android studios, I have successfully imported a library called ChatKit(https://github.com/stfalcon-studio/ChatKit). The creators of the library were kind enough to include a fully working sample within the library. Instead of recreating the process I want to import the sample from the library into my project but android studios is not allowing me to do so.
In my main activity, I can add :
import com.stfalcon.chatkit.dialogs.DialogsList;
But when cannot add:
import com.stfalcon.chatkit.sample.ChatSamplesListAdapter;
So I'm curious what other people have done to import a sample from an already imported library.
Thank you.
import com.stfalcon.chatkit.sample.ChatSamplesListAdapter;
It happens because this class is not included in the library.
It is a sample file used as sample.
As you can see it is just a simple RecyclerView.Adapter then you can copy it in your project or you can use a own adapter.

Andengine importing error

I try integrate AndEngine Library to my project I download Lib from AndEngine , and download some extension but I find problem with multi-touch
this problem I find this importing
import org.anddev.andengine.util.SystemUtils;
I search and I find the soluation
https://gamedev.stackexchange.com/questions/48427/cant-set-up-andengine-gles2-anchorcenter-examples-extensions
I try it and it solve my problem
but I still have some problems in some imports
import org.anddev.andengine.input.touch.controller.BaseTouchController;
import org.anddev.andengine.input.touch.TouchEvent;
import org.anddev.andengine.input.touch.detector.BaseDetector;
what I missing , any one can help me
These imports are for AndEngine-GLES1, you have to use the new packages (org.andengine)

Android studio import fails

Im trying to import the sample SDK APIDemos app (I also tried to import another project I have in eclipse) and in both cases it says "Grade refresh build failed... peer not authenticated".
I check on the eclipse project gradle propeties file that it is http and not https and still same problem.
Any ideas?
Thanks!
UPDATE: now I am getting the same problem when trying to create a new project, please help!

Cannot import google cloud endpoints client library class in Android project

I'm having difficulty getting Google Cloud Endpoints working. I have an Python endpoints project running on GAE and it works perfectly using the api explorer. However I'm struggling to properly generate the client library and use it in my android app. I've tried a number of sample projects and have the same problem every time; I can't import and use the model classes from the client libraries.
Here's what I'm doing (for this example I'll use the helloworld api python sample at https://github.com/GoogleCloudPlatform/appengine-endpoints-helloendpoints-python)
Unzip the sample code
Generate the client library by navigating to folder and running
<gae-sdk>\endpointscfg.py get_client_lib java helloworld_api.HelloWorldApi
Unzip the generated folder and copy into root of project in eclipse
In Eclipse add "your_app_id_appspot_com-helloworld-v1-20140310110152-java-1.17.0-rc-sources.jar" to build path (Right click the JAR> Build Path>Add to Build Path)
At this stage, I can import com.appspot.your_app_id.helloworld.model.*but I cannot import com.appspot.your_app_id.helloworld.model.Greeting
Can anyone shed any light on what's happening here? I have tried many different ways to get this to work but have the same problem every time.
Many thanks,
Tom
The problem is that by default, the generated zip file only contains a sources jar, not an actual compiled library jar which your Android app can use.
Here's the solution:
In your backend api folder (from the same place where your app.yaml is located), generate the client library as a gradle library, like so:
<gae-sdk-path>\endpointscfg.py get_client_lib java -bs gradle helloworld_api.HelloWorldApi
You'll now have a helloworld-v1.zip. Unzip this (either right here or in somewhere convenient like ~/temp)
This will create a folder called helloworld, which should have a build.gradle in there along with a src folder.
Build your client library using "gradle install" in this folder.
Copy build/libs/helloworld-v1-1.X.X-SNAPSHOT.jar into your Android app's libs folder.
Add it as a library in Android Studio by right-click/add-as-library.
Your classes should now resolve correctly.
Step 4 should install the just-built client library into your local maven repository. You can follow the instructions in readme.html in the helloworld/ folder you extracted to integrate directly with your Android app's gradle build system instead of copying the jar your built manually.
This post said that there is a bug with Android Studio's Add As Library: Android Studio: IncorrectOperationException when 'Add as Library' is clicked whilst trying to configure Google Apps Endpoints client libraries
Not sure if it applies to Eclipse.
I was able to solve this problem and have provided the solution below.
I switched to Android Studio Preview 0.4.6 from Eclipse which helped get rid of some of Googles library import issues(through I guess build.gradle config). I feel it was not a problem of Eclipse which I was using earlier.
I was able to to fix the import issues. The code on the tutorial segments on the official Google docs needs to be put in sync.
The solution is to roughly do the following changes:
In MainActivity.java, replace:
HelloGreeting with HelloworldApiGreeting
In MainActivity.java, add the following at the top:
import android.widget.Toast;
import android.os.AsyncTask;
import android.util.Log
import com.appspot.androidbackend1.helloworld.model.HelloworldApiGreeting;
import com.appspot.androidbackend1.helloworld.model.HelloworldApiGreetingCollection;
In MainActivity.java, comment the following at the top:
import com.appspot.androidbackend1.helloworld.Helloworld.Greetings.Multiply;
import com.appspot.androidbackend1.helloworld.model.HelloGreeting;
In Application.java, add the following at the top:
import com.appspot.androidbackend1.helloworld.model.HelloworldApiGreeting;
In Application.java, replace:
HelloGreeting with HelloworldApiGreeting
Hope this saves time for others

Andengine Library setup

Please help me add All Andengine Library.
I have imported AndEngineExamples But now it is asking me add other library reference.
Once i go in Project Properties it shows me Red cross mark in all linked libraries.
Please Please help to set my and engine libraries
The following link shows a video on how to download all the andengine libraries. It helped me get started:
How to setup andengine (and everything else to get started: Eclipse, Android SDK, java, github, ...)
You have to download all libraries from GitHub.
Then import all libraries into workspace.
Download andEngine Examples from GitHub.
Import this project also into workspace.
To remove read mark errors in examples import all other libraries to this example project.
Follow this link. It is shown with images with AS 2.2.3

Categories

Resources