怎麼用andriod曲線圖集成app
工具/原料
財務報表開發軟件:FineReport7.1.1
大小:148.2M 適用平臺:windows
方法/步驟
1. 資源準備
準備好需要集成FineReport App的Android工程,並下載FineReport提供的集成資源包。
點擊android.zip,下載資源包,將其解壓,得到如下圖所示幾個文件:
將解壓出來的libs目錄和res目錄拷貝需要集成的Android工程項目中,並將libs目錄下的JAR包和armeabi目錄作為依賴庫引用到Android開發工程中,如下圖:
2. 修改AndroidManifest.xml文件
打開自己工程下的AndroidManifest.xml文件,並將解壓出來的FineReport提供的AndroidManifest.xml中的內容寫入到自己工程下的配置文件中
3. 集成使用FineReport App
FineReport Android App提供了2種類型的接口:直接使用url訪問服務器上的模板,以連接的形式集成至自己的App當中,另外一種是使用目錄入口集成,即通過驗證用戶名密碼,登錄到FineReport App的主頁或者目錄頁。
3.1 URL直接集成
使用URL集成. 直接使用URL訪問服務器工程模板,比如說我們想要集成服務器下的WorkBook2.cpt模板,並且是填報的形式,那麼,代碼如下:
Intent intent = new Intent();
intent.putExtra("url",";op=write");
intent.setClass(this, IntegrationActivity.class);
startActivity(intent);
注:op=write表示參數op為write填報模式,正常預覽模板,不需要添加op參數。
2. 修改AndroidManifest.xml文件
打開自己工程下的AndroidManifest.xml文件,並將解壓出來的FineReport提供的AndroidManifest.xml中的內容寫入到自己工程下的配置文件中
3. 集成使用FineReport App
FineReport Android App提供了2種類型的接口:直接使用url訪問服務器上的模板,以連接的形式集成至自己的App當中,另外一種是使用目錄入口集成,即通過驗證用戶名密碼,登錄到FineReport App的主頁或者目錄頁。
3.1 URL直接集成
使用URL集成. 直接使用URL訪問服務器工程模板,比如說我們想要集成服務器下的WorkBook2.cpt模板,並且是填報的形式,那麼,代碼如下:
Intent intent = new Intent();
intent.putExtra("url",";op=write");
intent.setClass(this, IntegrationActivity.class);
startActivity(intent);
注:op=write表示參數op為write填報模式,正常預覽模板,不需要添加op參數。
3.2 使用目錄歡迎入口集成
使用目錄歡迎入口集成,直接登陸報表主頁或者目錄就相當於將FineReport的App嵌入到自己的App當中,當需要進入到FineReport App的時候,只需要發送相應的用戶名密碼驗證即可登錄到FineReport App的主頁或者目錄頁當中,接口如下:
Intent welcomeIntent = new Intent(this, LoadAppFromWelcomeActivity.class);
welcomeIntent.putExtra("username", "demo"); // 數據決策系統 用戶名
welcomeIntent.putExtra("password", "demo"); // 數據決策系統 用戶密碼
welcomeIntent.putExtra("serverIp", ";); // 數據決策系統 地址ip
welcomeIntent.putExtra("serverName", "demo服務器"); // 數據決策系統 名稱
startActivity(welcomeIntent);
注:如果服務器系統中設置了主頁,那麼登錄完成之後就跳轉到主頁,如果沒有設置主頁,就直接顯示目錄頁。