Creating Projects

This page describes how to create and run a project using the LG QPair APIs.

Creating an Android Project

1. Start Eclipse.

 

2. Select File > New > Android Application Project.

 

image218_17.png

 

3. Fill in the form as follows.

 

image218_18.png

 

Application Name: Enter the appropriate name for your application.

Project Name: Enter the appropriate name for your application.

Minimum Required SDK: Select the ‘API 16: Android 4.1 (Jelly Bean)’.

LG QPair SDK requires the minimum level of Android API 16.

 

4. Check the boxes if you need to and click Next or Finish.

 

Creating a launcher icon or activity is not mandatory for applications using QPair. Those settings depend on the purpose of your application.

 

5. With the options above, the Android Project will be created as follows.

 

 

Importing LG QPair Library to Project

In order to use the LG QPair APIs, you need to import the library named LGQPairAPIs.jar into your project. The library is included in the LG QPair SDK package. The importing process is as follows:

 

1. Copy the library file from the libs directory of the SDK's root path to the libs directory of the project.

If you installed the LG QPair SDK through Android SDK Manager, the root path of the SDK is ‘{Android SDK root}/extras/LG/QPair

If there is no libs in your project directory, please create it.

 

2. Refresh Eclipse by pressing the F5 key. You can then see the library in the libs directory.

 

3. Right-click on the library and select Build Path > Add to Build Path.

 

image218_21.png

 

4. When finished, make sure that you can see the LGQPairAPIs.jar in the Android Private Libraries.

 

image218_22.png

 

You are now ready to develop an Android application using the LG QPair SDK.

Downloading LG QPair Library from Maven Central Repository

 

If you are using maven or gradle build, downloading the QPair library from the maven central repository is another option. The configuration for the download is provided here.

 

For Maven Project

In your pom.xml, add the dependency for the QPair library.


   com.lge.developer
   qpair-apis
   2.0.0

For QPair SDK revision 1, set 1.0.0 in the <version> tag.

To find the more information about maven, refer to Apache Maven Project.

 

For Gradle Project

 

In your build configuration file, build.gradle, add following codes.

repositories{
   mavenCentral()
}
dependencies{
   compile 'com.lge.developer:qpair-apis:2.0.0'
}

For QPair SDK revision 1, set ‘compile com.lge.developer:qpair-apis:1.0.0’ in dependencies.

To find the more information about gradle, please refer to Gradle.

Running Application using LG QPair

 

You can run an application developed using the LG QPair SDK on real devices in the same way as other Android applications.

 

1. Connect a phone and a tablet using the QPair application. If you already made the QPair connection, you do not need to connect again.

 

image218_23.png

 

2. Connect the device on which you want to install the application with your PC.

If your PC does not recognize the device, install the USB driver for LG smartphones from the LG Electronics website: http://www.lg.com

 

3. Run the application by selecting from the menus in Eclipse as follows: project name > Run As > Android Application.

 

image218_24.png

 

4. When the pop-up window appears, select the device and then click OK.

 

image218_25.png

 

5. Use the application to communicate with the peer device.

Navigation