2. LG Developer Program
• What does LG Developer do for developers?
• LG’s New Developer Program
3. LG Developer Program
• LG Developer accelerates
the development and delivery
of great 3rd party applications
on LG smart devices.
’15
’14
’13, Aug
’12, Sep
G2
’11, Nov
’11, Apr
G Pad 8.3
Optimus 3D Cube
’10, Aug
’09, Jun
Optimus 3D
’08, Oct
3
4. LG’s New Developer Program
Are you creating an app for LG smart devices?
But don’t have a device to test your app on?
Borrow an LG smart device through the LG Device Loaner Program!
November
4th,
2013
4
5. LG Device Loaner Program
How to borrow an LG Device
Registration
Register as a member
of the LG Device
Loaner Program.
Order
Receive
Click Order and submit
your order form.
Receive the LG device
and test your app on it.
Return
Return the LG device
to us within the loan
period.
Order form
Security
deposit
Test your app on
LG devices
Pack the device
and return
5
6. LG Device Loaner Program
Available Devices
• G2 Verizon (VS980)
• G2 AT&T (D800)
• Optimus G Pro AT&T (E980)
• Optimus L9 T-Mobile (P769)
• ENACT Verizon (VS890)
6
7. LG Device Loaner Program
For more information
• http://developer.lge.com
One-stop resource for all developer requirements for LG smart
devices
7
9. LG Quick Series UX
QuickRemote
QuickMemo
QSlide
QuickTranslator
üRecognition for 43
languages and translate to
64 languages with Camera.
Qvoice(voicemate)
üYou can control TV,
Cable box, Airconditioner and so on
üYou can Memo and
scrap through Quick
button every screen.
ex) During calling, you
can Memo with Qmemo
üInnovative
Multitasking for
Multiscreen and
Multiaction.
Ex) During Videos, you
can see DMB or Memo.
üYou can check Dictionary,
Searching, Schedule, calling
with voice.
9
10. Why use LG QuickRemote?
At home, you have remote control for your TV, air conditioner, stereo and
fan.. but they are not always there when you need them, are they?
- QuickRemote features
- QRemote SDK
Learning
- Feedback from You
• throughout
• networking
• forum http://developer.lge.com/
Control home electronics from TV to air conditioner,
all with QuickRemote
10
12. QuickRemote: Why quick?
• Auto display at home
• Noti-bar and Lockscreen widgets
Knows when you are at home
12
13. QuickRemote: Rich functionality
Enjoy diversity of
devices.
Adjust devices to
your personal space.
Multiple devices
Space profile
Learning function
Magic remote
Control from the
bottom of your heart.
Control smart
content.
13
16. LG QRemote SDK
• Overview
• Sample App & API
• Developer tips
• Supporting devices
• LG Developer site
• Suggestions for SDK use cases
17. What can we do with LG QRemote SDK?
Realize your Brilliant apps!
• Customized UX design
• Adding new features
• Imagine you can do like this:
from
Template
Review Articles of QuickRemote
17
18. Overview of LG QRemote SDK
Content Provider
LG
QuickRemote
3rd Party App
Device
ID
Device
info
QRemote APIs
LG
QRemote SDK
IR
Element
IR
Blaster
IR Services
Control Service
* 3rd party app can
access to
Setup Service
* accessible only through
QuickRemote
18
19. Sample App & Major APIs
Sample App UI
Major APIs
Device List
Function List
Adding device. Result: Success
LG à TV à Power On à Success
Log TextView
Add/Delete a Device
19
20. Sample App & Major APIs
Sample App UI
Major APIs
class IRBlaster
Interface IRBlasterCallback
getIRBlaster()
IRBlasterReady()
getDevices()
newDeviceId()
Device List
Function List
addDevices()
sendIR()
stopIR()
Adding device. Result: Success
LG à TV à Power On à Success
close() TextView
Log
Refer to LG QRemote API Reference at http://developer.lge.com
20
21. Basic workflow
Application
• Creating a IRBlaster instance
and binding IR Service:
getIRBlaster()
• Getting the Device information:
getDevices()
IRBlaster
Class
getIRBlaster()
IR Services
bindService()
IRBlasterReady()
getDevices()
[list of devices]
• Select a device and show a
corresponding layout
[list of devices]
[select device]
• Handling supported functions by a
selected Device
IControl.getDevice()
[match functions]*
sendIR()
• Sending the IRSignals:
sendIR()
• Unbinding IR Service:
close()
[result]
IControl.sendIR()
[lresult]
close()
unbindService()
* IRFunctionLabels in Revision 2
21
22. Match functions
• Every device and brand may have different set of functions
• Fake function Names: ex. Air-conditioner
Real behavior:
Temperature UP
Raw function names:
Skip Forward
IRFunctionLabels in Revision 2
public
public
public
public
public
public
public
static
static
static
static
static
static
static
final
final
final
final
final
final
final
String
String
String
String
String
String
String
IR_FUNCTION_LABEL_TEMP_UP_AIRCON = "SKIP FORWARD";
IR_FUNCTION_LABEL_TEMP_DOWN_AIRCON = "SKIP REVERSE";
IR_FUNCTION_LABEL_FAN_AIRCON = "BLUE";
IR_FUNCTION_LABEL_FAN_UP_AIRCON = "PAGE -";
IR_FUNCTION_LABEL_FAN_DOWN_AIRCON = "FAVORITE";
IR_FUNCTION_LABEL_HORIZONTAL_SWING_AIRCON = "PIP INPUT";
IR_FUNCTION_LABEL_VERTICAL_SWING_AIRCON = "PIP ON";
VS
22
23. Match functions
• Every device and brand may have different set of functions
• Fake function Names: ex. Air-conditioner
IRBlaster
Class
Application
Buttons[i].Name ==
KeyFunctions[j].Name
getDevices()
[list of devices]
Buttons[]
View.setTag()
[select Device]
Buttons[i].Id =
KeyFunctions[j].Id
[match functions]
Device
+Id: int
+KeyFunctions: list
0..1
KeyFunctions
0..*
getFunctionKeyCode()
public class IRFunctionLabels {
public static final String IR_FUNCTION_LABEL_VOLUME_DOWN_TV = "VOLUME -";
public static final String IR_FUNCTION_LABEL_MUTE_TV = "MUTE";
…
public static final String IR_FUNCTION_LABEL_POWER_TV = "POWER";
public static final String IR_FUNCTION_LABEL_POWER_ON_TV = "POWER ON";
IRFunction
+Name: String
+Id: int
sendIR(…)
[result]
23
24. Add device
• Add device through QuickRemote
and receive a notification through
the registered callback:
newDevice()
• Handle relevant devices
getIRBlaster(..)
IRBlasterCallback
+IRBlasterReady()
+newDeviceId(int Id)
public IRBlasterCallback mIrBlasterReadyCallback
= new IRBlasterCallback() {
@Override
public void IRBlasterReady() {
final Runnable r = new Runnable() {
public void run() {
getDevices();
}
};
mHandler.post(r);
mIR_ready = true;
}
@Override
public void newDeviceId(int id) {
Toast.makeText(…).show();
}
};
IRBlaster
Class
Application
IRBlasterReady()
addDevice()
newDevice(Id)
[store Id]
24
25. Error handling
retry
• public static final int SUCCESS = 0; retry or warn
• public static final int ERROR = 1;
• public static final int SERVICES_NOT_READY = 9;
if (resultCode ==
ResultCode.SERVICES_NOT_READY) {
if (mRetries < MAXRETRIES /*3*/) {
// wait for services ready
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
retries++;
getIRBlaster();
} else {
retries = 0;
showFatalError();
}
}
• public static final int OUT_OF_MEMORY = 7;
• public static final int ERROR_OPENING_DATABASE = 11;
clean RAM/ROM
ask a user to delete
• public static final int MAXIMUM_DEVICES_REACHED = 8; devices
warn: can’t delete
• public static final int INVALID_AUTHENTICATION_KEY = 10; this device
• public static final int DELETE_DEVICE_ERROR = 17;
25
26. Developer tips
• Wait IRBlasterCallback.IRBlasterReady()
• sendIR with 0 (continuous) or >250ms (~300ms) duration
• Always call stopIR after sendIR with 0 duration
• sendIR/stopIR in Handler
• Handle multi-touch android:splitMotionEvents="false"
• Portrait mode android:screenOrientation="portrait“
• Maximum devices allowed 96 (including 24 of QuickRemote)
26
31. Open APIs sample
• Make a difference using open APIs which provide useful information.
What
song is it?
Useful
info from
web
What
programs
on TV?
Open APIs
• Macros
- One click, more actions
- Call sendIRList()
- Create your own macros!
Eject tray
TV on
DVD on
31
32. Hybrid app sample
• Reach web technologies + powerful phone features
- Web UI can use LG QRemote APIs through Apache Cordova plugin
• Development
- Develop a web application with cordova.js
- Call cordova.exec() to fetch QRemote APIs (If plugin is already ready)
- Import the web application files into an Android application
- Run the Android application on a LG phone
32
33. Widget sample
<receiver android:name=
AndroidManifest.xml
"com.lge.example.sdkwidgettest.RemoteAppWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<intent-filter>
<action
android:name="com.lge.example.sdkwidgettest.remote_widget_button_click"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/remote_appwidget_info"/>
</receiver>
remote_appwidget_info.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="360dp"
Widget can be added in
android:minHeight="110dp"
android:updatePeriodMillis="0"
Keyguard or Home screen
android:previewImage="@drawable/widget_preview"
android:widgetCategory="keyguard"
android:configure="com.lge.qremote.appwidget.RemoteAppWidgetDummyActivity"
android:initialLayout="@layout/lockscreen_remocon_loading" >
</appwidget-provider>
RemoteAppWidgetProvider.java
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager,
int[] appWidgetIds) {
RemoteViews views = new RemoteViews(context.getPackageName(),
Widget main layout xml file
R.layout.widget_main);
Intent powerClickIntent = new Intent(WidgetApplication.BUTTON_CLICK);
powerClickIntent.putExtra(BUTTON_TYPE, POWER);
...
}
33
35. Suggestions for SDK use cases
• Flexible UI (learn user behaviors)
• Integrates SNS
• Use full range of functions
• Auto detection (camera)
• Voice commands
• Context aware apps
– (geo-location): get local
favorite channels
– activity: adjust environment
– auto-launch device specific layout
35