本文整理汇总了Java中com.kinvey.android.Client类的典型用法代码示例。如果您正苦于以下问题:Java Client类的具体用法?Java Client怎么用?Java Client使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Client类属于com.kinvey.android包,在下文中一共展示了Client类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_kitchen_sink);
bindViews();
Client myClient = ((KitchenSinkApplication)getApplication()).getClient();
if (!myClient.user().isUserLoggedIn()) {
Intent login = new Intent(this, LoginActivity.class);
startActivity(login);
}
// run the following comamnd to turn on verbose logging:
//
// adb shell setprop log.tag.HttpTransport DEBUG
//
Logger.getLogger(HttpTransport.class.getName()).setLevel(LOGGING_LEVEL);
}
开发者ID:KinveyApps,项目名称:Kitchensink-Android,代码行数:20,代码来源:KitchenSink.java
示例2: loadClient
import com.kinvey.android.Client; //导入依赖的package包/类
public void loadClient(KinveyUserCallback callback){
if (client == null){
client = new Client.Builder(getApplicationContext()).setRetrieveUserCallback(callback).setUserClass(ContentUser.class).build();
client.enableDebugLogging();
}else{
if(callback != null){
if (client.user().isUserLoggedIn()){
callback.onSuccess(client.user());
}else{
callback.onFailure(new NullPointerException(""));
}
}
}
}
开发者ID:KinveyApps,项目名称:ContentBox-Android,代码行数:16,代码来源:ContentViewrApplication.java
示例3: getItemId
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public long getItemId(int position) {
if (position == 0){
return -1;
}else if (position == 1){
return -2;
}
if (position >= ((List<String>) getClient().user().get("ordering")).size() + STATIC){
return 0;
}
Log.i(Client.TAG, "content type pager, position is: " + position + " and ordered is: " + (position - STATIC));
List<String> order = (List<String>) getClient().user().get("ordering");
return getContentType().get(order.get(position - STATIC)).getUniqueID();
}
开发者ID:KinveyApps,项目名称:ContentBox-Android,代码行数:16,代码来源:ContentTypePager.java
示例4: bindViews
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void bindViews(View v) {
roboto = Typeface.createFromAsset(getActivity().getAssets(), "Roboto-Thin.ttf");
notifyTitle = (TextView) v.findViewById(R.id.notify_update_title);
updatesLabel = (TextView) v.findViewById(R.id.notify_update_label);
updates = (Switch) v.findViewById(R.id.notify_updates);
notifyTitle.setTypeface(roboto);
updatesLabel.setTypeface(roboto);
updates.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (b) {
client().push().initialize(getActivity().getApplication());
updates.setChecked(true);
} else {
client().push().disablePush();
updates.setChecked(false);
}
}
});
Log.i(Client.TAG, "Push status -->" + Boolean.toString(client().push().isPushEnabled()));
if (client().push().isPushEnabled()){
updates.setChecked(true);
}else{
updates.setChecked(false);
}
}
开发者ID:KinveyApps,项目名称:ContentBox-Android,代码行数:35,代码来源:NotificationFragment.java
示例5: getClient
import com.kinvey.android.Client; //导入依赖的package包/类
public Client getClient(){
if (getContentViewr() != null){
return getContentViewr().getClient();
}else{
return null;
}
}
开发者ID:KinveyApps,项目名称:ContentBox-Android,代码行数:8,代码来源:ContentFragment.java
示例6: onCreate
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
uiHelper = new UiLifecycleHelper(getActivity(), callback);
uiHelper.onCreate(savedInstanceState);
kinveyClient = new Client.Builder(getActivity()).build();
}
开发者ID:KinveyApps,项目名称:Scrumptious-Android,代码行数:9,代码来源:SelectionFragment.java
示例7: onCreate
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_geo_tag);
// ensure the current device can even support running google services,
// which are required for using google maps.
int googAvailable = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(this);
if (googAvailable != ConnectionResult.SUCCESS) {
Log.i(TAG, "googAvailable fail!");
GooglePlayServicesUtil.getErrorDialog(googAvailable, this, 0)
.show();
} else {
bindViews();
mMap.onCreate(savedInstanceState);
mMap.getMap().setMyLocationEnabled(true);
setListeners();
mKinveyClient = new Client.Builder(this).build();
//login and fire off the ping call to ensure we can communicate with Kinvey
if(mKinveyClient.user().isUserLoggedIn()) {
mKinveyClient.user().login(new KinveyUserCallback() {
@Override
public void onSuccess(User result) {
testKinveyService();
}
@Override
public void onFailure(Throwable error) {
Toast.makeText(GeoTag.this, "Couldn't login -> " + error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
}
开发者ID:KinveyApps,项目名称:GeoTag-Android,代码行数:41,代码来源:GeoTag.java
示例8: onCreate
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
sharedClient = new Client.Builder(this).build();
}
开发者ID:KinveyApps,项目名称:Android-Starter,代码行数:6,代码来源:App.java
示例9: getSharedClient
import com.kinvey.android.Client; //导入依赖的package包/类
public Client getSharedClient(){
return sharedClient;
}
开发者ID:KinveyApps,项目名称:Android-Starter,代码行数:4,代码来源:App.java
示例10: getClient
import com.kinvey.android.Client; //导入依赖的package包/类
public Client getClient() {
if (myClient == null) {
myClient = new Client.Builder(getApplicationContext()).build();
}
return this.myClient;
}
开发者ID:KinveyApps,项目名称:tictac-android,代码行数:7,代码来源:TicTacApplication.java
示例11: getClient
import com.kinvey.android.Client; //导入依赖的package包/类
public static Client getClient(Context context) {
return ((TicTacApplication) context.getApplicationContext())
.getClient();
}
开发者ID:KinveyApps,项目名称:tictac-android,代码行数:6,代码来源:TicTac.java
示例12: getClient
import com.kinvey.android.Client; //导入依赖的package包/类
public Client getClient(){
return client;
}
开发者ID:KinveyApps,项目名称:ContentBox-Android,代码行数:4,代码来源:ContentViewrApplication.java
示例13: getClient
import com.kinvey.android.Client; //导入依赖的package包/类
public Client getClient(){
return ((ContentViewrApplication)getApplication()).getClient();
}
开发者ID:KinveyApps,项目名称:ContentBox-Android,代码行数:4,代码来源:Contentviewr.java
示例14: client
import com.kinvey.android.Client; //导入依赖的package包/类
private Client client(){
return ((ContentViewrApplication)((SettingsActivity) getActivity()).getApplicationContext()).getClient();
}
开发者ID:KinveyApps,项目名称:ContentBox-Android,代码行数:4,代码来源:LoginFragment.java
示例15: onMessage
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void onMessage(String message) {
Log.i(Client.TAG, "GCM - onMessage: " + message);
displayNotification(message);
}
开发者ID:KinveyApps,项目名称:Kitchensink-Android,代码行数:6,代码来源:GCMLoggingReceiver.java
示例16: onError
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void onError(String error) {
Log.i(Client.TAG, "GCM - onError: " + error);
}
开发者ID:KinveyApps,项目名称:Kitchensink-Android,代码行数:5,代码来源:GCMLoggingReceiver.java
示例17: onUnregistered
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void onUnregistered(String oldID) {
Log.i(Client.TAG, "GCM - onUnregister");
}
开发者ID:KinveyApps,项目名称:Kitchensink-Android,代码行数:5,代码来源:GCMLoggingReceiver.java
示例18: onDelete
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void onDelete(String arg0) {
Log.i(Client.TAG, "GCM - onDelete, message deleted count: " + arg0);
}
开发者ID:KinveyApps,项目名称:Kitchensink-Android,代码行数:5,代码来源:GCMLoggingReceiver.java
示例19: onRegistered
import com.kinvey.android.Client; //导入依赖的package包/类
@Override
public void onRegistered(String arg0) {
Log.i(Client.TAG, "GCM - onRegister, new gcmID is: " + arg0);
displayNotification("onRegister");
}
开发者ID:KinveyApps,项目名称:Kitchensink-Android,代码行数:6,代码来源:GCMLoggingReceiver.java
示例20: getClient
import com.kinvey.android.Client; //导入依赖的package包/类
public Client getClient(){
return ((KitchenSinkApplication) getApplicationContext()).getClient();
}
开发者ID:KinveyApps,项目名称:Kitchensink-Android,代码行数:4,代码来源:FeatureActivity.java
注:本文中的com.kinvey.android.Client类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论