【仅供内部供应商使用,不提供对外解答和培训】

Page tree

【仅供内部供应商使用,不提供对外解答和培训】

Skip to end of metadata
Go to start of metadata

FR提供了多种方式的集成, 以便于客户在移动端查看预览模板. 其中包括:  原生模板预览, 原生APP预览.  首先我们来配置工程进行引用.

第一步: 创建并配置工程,  (具体方法参见工程配置部分)  如果已下载了FR提供的集成AppDemo, 使用IDEA或Android Studio直接OPEN工程即可. 

 

      下载地址:https://dn-finereportmobiledemo.qbox.me/android.html?v=1453428447083

     (ps:后面的v后面接的是时间戳参数,避免页面缓存影响,请将v=后面的时间戳参数换成下载时的最新时间)

第二步:  在应用程序创建时初始化 SDK引用的Context 全局变量

         FRSDK.initSDK(context)

第三步:  创建新的Activity, 直接通过URL 原生预览模板.

 
public class TestLoadUrlActivity extends Activity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);

 Intent intent = new Intent();
 intent.putExtra("url","http://www.finereporthelp.com:8889/app/ReportServer?reportlet=app/DetailedDrillA-phone.cpt&op=write");
 intent.putExtra("title", "My Title");
 intent.setClass(this, LoadAppFromURLActivity.class);
 startActivity(intent);
}
}

第五步:  创建新Activity, 通过登录访问模板

public class TestLoginActivity extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 IFOEMUtils.setUseGuidePage(true); // 在第一次安装加载时, 是否启用引导页.
 Intent welcomeIntent = new Intent(this, LoadAppFromWelcomeActivity.class);

 welcomeIntent.putExtra("username", "demo"); // 数据决策系统 用户名
 welcomeIntent.putExtra("password", "demo"); // 数据决策系统 用户密码
 welcomeIntent.putExtra("serverIp", "http://www.finereporthelp.com:8889/app/ReportServer"); // 数据决策系统 地址ip
 welcomeIntent.putExtra("serverName", "demo服务器"); // 数据决策系统 名称

 startActivity(welcomeIntent);

}
}

 


 

 

 

 

  • No labels