-
Notifications
You must be signed in to change notification settings - Fork 9
[EN] Android Studio Sample
Changhoon Yang edited this page Oct 11, 2016
·
2 revisions
The following steps show you how to run a sample project for the NAVER Cafe SDK in Android Studio.
- Go to the sample/navercafesdk-sample-android-studio folder and open a project.
- Build the project.
- Check if the NAVER Cafe SDK is running on your app.
Note that the sample project includes the initialization and app manifest files required to run the NAVER Cafe SDK.
Use the onCreate() method of the main activity to define initialize options for the NAVER Cafe SDK. The init() method is used to initialize the NAVER Cafe SDK.
public class MainActivity extends Activity {
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/**
* Initialize the NAVER Cafe SDK using information obtained when you registered your application in NAVER Login Developers.
* You must perform the initialization before you call methods of the Glink class.
* NAVER Login Developers: https://nid.naver.com/devcenter/main.nhn
*/
final int cafeId = 28290504;
final String clientId = "197CymaStozo7X5r2qR5";
final String clientSecret = "evCgKH1kJL";
Glink.init(this, clientId, clientSecret, cafeId);
...
}
Use the startHome() method to start the NAVER Cafe SDK with the Home tab selected.
Glink.startHome(MainActivity.this);
The app manifest setting is included in the AndroidManifest.xml file, which belongs to a library (.arr file). Therefore, you don't have to edit the AndroidManifest.xml file in order to run a sample project.