原文地址:http://u.10-tips-designing-your-mobile
在移动开发中,客户端通常需要一个基于Web云的API服务(Service)来实现C/S通信。最简化这些API的用例通常是获取(Read/Retrieve)云端数据,但并非局限于此,向云端发送数据、用户认证与管理等都可以基于该Web云服务实现。
你若想在你的移动端应用程序中,使用Web云API服务的话,下面10个坑是你应该知道的:
原文地址:http://u.10-tips-designing-your-mobile
在移动开发中,客户端通常需要一个基于Web云的API服务(Service)来实现C/S通信。最简化这些API的用例通常是获取(Read/Retrieve)云端数据,但并非局限于此,向云端发送数据、用户认证与管理等都可以基于该Web云服务实现。
你若想在你的移动端应用程序中,使用Web云API服务的话,下面10个坑是你应该知道的:
TRANSACTION(事务隔离级别) | |
1. ISOLATION_DEFAULT:这是一个PlatfromTransactionManager默认的隔离级别,使用数据库默认的事务隔离级别。 | |
每种数据库的默认隔离级别是不同的,例如SQL Server、Oracle默认Read Commited,MySQL默认Repeatable Read。 | |
另外四个与JDBC的隔离级别相对应,不同的隔离级别采用不同的锁类型来实现,在四种隔离级别中,Serializable的 | |
隔离级别最高,Read Uncommited的隔离级别最低。 | |
2. ISOLATION_READ_UNCOMMITTED:读未提交数据,这是事务最低的隔离级别,在并发的事务中,它充许一个事务可以 | |
读到另一个事务未提交的更新数据。(会出现脏读,不可重复读和幻读) | |
3. ISOLATION_READ_COMMITTED:读已提交数据,保证在并发的事务中,一个事务修改的数据提交后才能被另外一个事 |
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix. | |
All Clickable Views: | |
----------- | |
* ripple effect (Lollipop only) -- "colorControlHighlight" | |
Status Bar: | |
------------ | |
* background (Lollipop only) - "colorPrimaryDark" |
import android.os.Bundle; | |
import android.support.design.widget.AppBarLayout; | |
import android.support.design.widget.TabLayout; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import com.blackcj.designsupportexample.adapters.RecyclerViewAdapter; |
<?xml version="1.0" encoding="utf-8"?><!-- | |
~ Copyright (C) 2015 The Android Open Source Project | |
~ | |
~ Licensed under the Apache License, Version 2.0 (the "License"); | |
~ you may not use this file except in compliance with the License. | |
~ You may obtain a copy of the License at | |
~ | |
~ http://www.apache.org/licenses/LICENSE-2.0 | |
~ | |
~ Unless required by applicable law or agreed to in writing, software |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.NinePatchDrawable; | |
import android.util.AttributeSet; | |
import android.widget.RelativeLayout; | |
public class FRelativeLayout extends RelativeLayout { |
byte[] photoByteArray = Files.toByteArray(photo.getImageFile()); | |
BlipoApi blipoApi = setUpNetwork(); | |
blipoApi.uploadPhoto(photoByteArray); | |
private BlipoApi setUpNetwork() { | |
RequestInterceptor requestInterceptor = new RequestInterceptor() { | |
@Override | |
public void intercept(RequestFacade requestFacade) { | |
String imageId = UUID.randomUUID().toString(); |
package com.f2prateek.five00px.data.api.auth; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Map; | |
import oauth.signpost.http.HttpRequest; | |
import retrofit.client.Header; | |
import retrofit.client.Request; |