iOS和wikipeadia集成的技术实现

onCreate:

iOS和wikipeadia集成的技术实现
iOS和wikipeadia集成的技术实现
iOS和wikipeadia集成的技术实现

After click log in and wait for a while:

iOS和wikipeadia集成的技术实现
iOS和wikipeadia集成的技术实现

This will trigger constructor.
Fetch service document and meta data in constructor.

iOS和wikipeadia集成的技术实现
iOS和wikipeadia集成的技术实现

Asynchronous task: The trigger point is in thread 1.

iOS和wikipeadia集成的技术实现

onSucceed: thread 17.

iOS和wikipeadia集成的技术实现

Since service document is loaded, next step is to try to load meta data. This is a state machine.

iOS和wikipeadia集成的技术实现

Service Document variable:

iOS和wikipeadia集成的技术实现

Now Load Metadata:

iOS和wikipeadia集成的技术实现

Now metadata loaded ok:

iOS和wikipeadia集成的技术实现

Metadata must be parsed with the help of service document:

iOS和wikipeadia集成的技术实现

InitialListener:

iOS和wikipeadia集成的技术实现

All thread lists:

iOS和wikipeadia集成的技术实现
iOS和wikipeadia集成的技术实现

Get Customer collection list:
And display in on UI:

iOS和wikipeadia集成的技术实现

Control has moved to here:

iOS和wikipeadia集成的技术实现

Get view is called:

iOS和wikipeadia集成的技术实现
iOS和wikipeadia集成的技术实现

Click one item:

iOS和wikipeadia集成的技术实现

onCreate: now create detail view:

iOS和wikipeadia集成的技术实现

How does Gateway URL is fetched based on Application

private void loadServiceDocument() throws MessagingClientException, SDMParserException {
       //progressDialog.setMessage(app.getString(R.string.load_service_doc));
             //progressDialog.show();
             SDMConnectivityParameters params = new SDMConnectivityParameters();
             params.setUserName(app.getUserName());
             params.setUserPassword(app.getUserPassword());
             params.setBaseUrl(app.getGatewayUrl());
 
             SDMLogger logger = new SDMLogger();
             SDMPreferences sprefs = new SDMPreferences(app.getApplicationContext(), logger);
            
             requestManager = new SDMRequestManager(logger, sprefs, params, 1);
            
             parser = new SDMParser(sprefs, logger);
             if (app.isSup()) {
                    LiteUserManager.initInstance(app.getApplicationContext(), Constants.SUP_APPLICATION_NAME);
                    LiteUserManager um = LiteUserManager.getInstance();
                    try {
 
                       LiteMessagingClient.initInstance(app.getApplicationContext(), Constants.SUP_APPLICATION_NAME);
 
                    } catch (MessagingClientException e) {
 
                          e.printStackTrace();
 
                    }
 
                    try {
 
                           LiteMessagingClient.getInstance().startClient();
 
                    } catch (MessagingClientException e) {
 
                          e.printStackTrace();
 
                    }
 
                   
                    if (um.isRegistered())
                    {
                          LiteAppSettings las = new LiteAppSettings();
                          try {
 
                                 this.serviceURL = las.getApplicationEndPoint();
                                 this.serviceURL = "http://ldcigm2.wdf.sap.corp:50018/sap/opu/sdata/sap/CUSTOMER_BRIEFING/";
                          requestManager.getConnectivityParameters().setBaseUrl(this.serviceURL);
                          requestManager.setMainHandlerClassName(SDMConstants.SDM_HTTP_HANDLER_CLASS);
                                
                          } catch (MessagingClientException e) {
                                 e.printStackTrace();
                          }
      
                    } else {
                          //show message that the user is not registered
                    }
             } else { // configure using gateway
             requestManager.setMainHandlerClassName(SDMConstants.SDM_HTTP_HANDLER_CLASS);
                    this.serviceURL = "http:" + app.getGatewayUrl() + Constants.DEFAULT_APP;
                   
             }
            
             // update language with every request
             String langCode = Locale.getDefault().getLanguage();
       requestManager.getConnectivityParameters().setLanguage(langCode);
            
 
             // prepare request
             ISDMRequest httpRequest = new SDMBaseRequest();
            
             httpRequest.setListener(this);
             httpRequest.setRequestUrl(this.serviceURL);
             System.out.println("!!!!!! Service URL: " + this.serviceURL);
          httpRequest.setRequestMethod(ISDMRequest.REQUEST_METHOD_GET);
              httpRequest.setPriority(ISDMRequest.PRIORITY_NORMAL);
            
             requestManager.makeRequest(httpRequest);

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
iOS和wikipeadia集成的技术实现

iOS和wikipeadia集成的技术实现

上一篇:[转译][马基 杰斯特(MarkeyJester) 摩托罗拉68000 入门教程] 贰 - 基本指令 | 3. SWAP 指令


下一篇:创建Struct2的web应用(一)