User Tools

Site Tools


developers:peig-api:android

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developers:peig-api:android [2018/07/04 12:14]
dskrbek [Responses]
developers:peig-api:android [2019/08/01 10:02]
tjotov removed
Line 1: Line 1:
 ====== Developing Android application with ADUCID ====== ====== Developing Android application with ADUCID ======
- 
-//See [[https://github.com/aducid-dev/peigapi-android/|DemoBank]] example - [[https://github.com/aducid-dev/peigapi-android/blob/master/demobank/bank/src/main/java/com/aducid/demo/bank/MainFragment.java|MainFragment.java]]// 
- 
 Prerequisites: used external libraries: Prerequisites: used external libraries:
  
Line 65: Line 62:
 Your session is authenticated Your session is authenticated
  
-In DemoBank, result.gerRedirect() contains link to page with account data+In DemoBank, result.gerRedirect() contains link to page with account data. Method result.containsRedirectUri() returns //true//, if redirect contains some link.
  
 II. II.
Line 98: Line 95:
       * result.notAcceptedByUser(): user rejected       * result.notAcceptedByUser(): user rejected
       * result.isFactorAbsent(): user doesn’t have personal factor (and server requires it)       * result.isFactorAbsent(): user doesn’t have personal factor (and server requires it)
-  * result.getData() contains error Message / reason+  * result.getData() contains error message / reason
   * result.getRedirect() contains page that could be opened using browser / contains additional content to download/ display to the user.   * result.getRedirect() contains page that could be opened using browser / contains additional content to download/ display to the user.
  
-//See PapiResult class for all details//+//See com.aducid.peig.lib2.Result class for all details//
  
 ===== Retrieve data when authenticated ===== ===== Retrieve data when authenticated =====
Line 108: Line 105:
  
 <code> <code>
-getPapi().getAsyncClient().get(String url, RequestParams parametersResponseHandlerInterface responseHandler)+peigApi.aducidContent(java.lang.String url, java.lang.String methodNameandroid.os.Handler handler)
 </code> </code>
  
-  * **url**  – target page / method URL, e.g. [[https://demobank.aducid.com/demobank/|https://demobank.aducid.com/demobank/]]**payment** +  * **url**  – target page / method URL, e.g. [[https://demobank.aducid.com/demobank|https://demobank.aducid.com/demobank]] 
-  * **parameters**  – specify https(s) request parameters for your request if needed +  * **methodName** - method path, e.g. /accountRemote 
-  * **AsyncHttpResponseHandler**  – callback to be executed when data is loaded+  * **handler**  – Android callback to be executed when data is loaded
 ==== Try to get data if not authenticated ==== ==== Try to get data if not authenticated ====
  
Line 120: Line 117:
 ===== Advanced requests ===== ===== Advanced requests =====
  
-To accomplish a specific action like transaction use aducidFullOperation()+To accomplish a specific action like transaction use aducidFullOperationGet() or aducidFullOperationPost().
  
-See DemoBank PaymentFragment.java example 
  
 <code java> <code java>
-aducidFullOperationPost(String url, String methodName,RequestParamsparameters, Handler handler)+peigApi.aducidFullOperationPost(String url, String methodName, com.loopj.android.http.RequestParams parametersandroid.os.Handler handler)
 </code> </code>
  
Line 135: Line 131:
  
 <code java> <code java>
-PapiResult result = msg.getData().getParcelable("result");+Handler handler = new Handler() { 
 +                    @Override 
 +                    public void handleMessage(Message msg) { 
 +                      
 +                        if (msg.getData() != null) { 
 +                            com.aducid.peig.lib2.Result result = msg.getData().getParcelable("result"); 
 +                            // do something with result 
 +                        } 
 +                    } 
 +                }
 </code> </code>