Modifying Code

 

The Quick Circle case is a smart phone cover case with a circular window cut-out on the front. The case not only provides protection for a smart phone - once attached, it also provides various UX features. For example, users can select apps directly through the cover's Quick Circle window. In addition, users can receive notifications and check new messages.

Modifying a Main Activity

To use a QCircle library, your activity needs to extend android.app.Activity class in Android.

Modify MainActivity as below.

import android.app.Activity;
...
public class MainActivity extends Activity{
...

Adding a QCircle Template

Now you are ready to implement your first Quick Circle application by adding a few lines of code.

1. In the main activity, import the package from the library.

import com.lge.qcircle.template.*;

 

2. Modify onCreate() method by followings way:

protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  QCircleTemplate template = new QCircleTemplate(this, TemplateType. CIRCLE_VERTICAL);
  setContentView(template.getView());
}

 

3. In Android Studio, select Make module ‘app’ from the Build menu.

In Eclipse, select Build Project from the Project menu.

Modifying the AndroidManifest File

The Quick Circle app is also launched through the Quick Circle menu. Users can choose the app to be added to the Quick Circle menu. To add your application to the Settings, declare an intent filter for Quick Circle in the AndroidManifest.xml file. Also, specify the icon for the Quick Circle activity.

<activity
      android:name=".MainActivity"
      ..
android:icon="@drawable/ic_launcher"
      >
<intent-filter>
       <action android:name="com.lge.quickcover" />
       <action android:name="android.intent.action.MAIN" />
       <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

 

Your app will appear in the Settings. If the user selects the application, the application can be launched directly from the Quick Circle menu.

Running a Quick Circle App

LG Quick Circle SDK does not provide an emulator. To run a Quick Circle application, you need to connect an actual device that supports the Quick Circle feature.

 

1. Use the Quick Circle case with your LG smart phone.

 

2. Go to Settings and turn on the smart function for Quick Circle case.


mobile_qcircle_develop_app_running_1.png
 

3. Connect your smart phone to the PC.

 

4. In Android Studio, select Run ‘app’ from the Run menu and choose a connected device.
In Eclipse, select Run as > Android Application from the Run menu and choose a connected device.


mobile_qcircle_develop_app_running_2.png
 

5. The application will run on the device.


mobile_qcircle_develop_app_running_3.png

Navigation