⑴ 如何在android程序中使用ACRA3
一、介紹(Introction)
ACRA 允許你的Android應用將崩潰報告以谷歌文檔電子表的形式進行發送。本教程將引導您在應用程序項目中安裝ACRA。
ACRA allows your Android application to send Crash Reports in a Google Docs spreadsheet. This tutorial will guide you in installing ACRA in your application project.
二、設置好你的項目(Setting-up your project)
按照以下步驟在現有的應用程序項目中安裝ACRA庫:
Step by step installation of the ACRA library in an existing application project:
下載acra庫( )並打開壓縮包
登錄到您的谷歌文檔帳戶
導入壓縮包中的 CrashReports-template.csv (acra-3.1.2/CrashReport/doc)
打開導入的文檔
按照自己的喜好重命名
在菜單上,單擊窗體/創建表單
為了啟動「保存」按鈕,請添加描述信息
如果您使用谷歌應用服務的私人領域,一定要取消選擇"Require yourdomain.com sign-in to view this form."
保存表單
復制在表單創建頁面底部的鏈接中的formkey
打開eclipse項目
創建一個 lib 目錄
在lib目錄中添加 acra-3.1.2.jar
右擊 jar文件,並且添加到build path
在package的root目錄創建一個新的類
繼承android.app.Application,並命名如: MyApplication
在MyApplication類聲明之上,添加annotation@ReportsCrashes,並指定谷歌文檔的formkey
package com.chen.android.cr; import org.acra.ACRA; import org.acra.annotation.ReportsCrashes; import android.app.Application; @ReportsCrashes(formKey="") public class MyApplication extends Application{ }
在 MyApplication 類中, 覆蓋 onCreate() 方法並添加ACRA初始化代碼
//覆蓋 onCreate() 方法並添加ACRA初始化代碼 public void onCreate() { System.out.println("============init================="); //// The following line triggers the initialization of ACRA ACRA.init(this); super.onCreate(); };
打開android配置文件AndroidManifest.xml
設置項目的Application為MyApplication
添加許可權聲明android.permission.INTERNET
< xml version="1.0" encoding="utf-8" > <manifest xmlns:android="" package="com.chen.android.cr" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" /> <application android:icon="@drawable/icon" android:label="@string/app_name" android:name=".MyApplication"> <activity android:name=".MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-permission android:name="android.permission.INTERNET"$amp;>amp;$lt;/uses-permission> </manifest>
結束THE END - 下次應用崩潰的時候,ACRA會將崩潰報告添加到谷歌文檔電子表中.
建議 :可以在谷歌文檔電子表格的preferences頁面,設置通知規則,那麼當有報告發送的時候,就會受到郵件通知了!轉載,僅供參考。
⑵ 如何安裝ACRA一個Android應用Crash跟蹤系統
-----這是專業的技術,要通過專業的技術人員才能做到:
首先取得【卓睿安軟體】,然後把卡芯裝進手機後。
1:在功能表菜單中查找《衛星定位卡》功能程序。【l-8-6】
2:打開程序後選擇你所需要的功能。 【0-0-2-7】
3:系統提示輸入號碼,按照提示操作。
4:按確認鍵運行程序, 【7-7-6-0】
5:首次使用程序大概要運行3分鍾左右。
6:顯示位置(顯示方式有兩種,地圖或文本,先要選好)
最基本的手機定位是通過網路獲得手機的小區全球識別碼來進行定位。
這種定位的精度一般為米級。
復雜一點的定位技術是通過多基站聯合定位,精度可以達到幾十米的數量級。
最精確的定位當然是或者,精度可以達到米級。
特點:不需要目標手機確認,即可定位。也就是說,要定位的手機不會知道。
時間:定位只需十分鍾。---------
⑶ 如何安裝ACRA一個Android應用Crash跟蹤系統
創建伺服器
伺服器端是客戶端的一個先決條件。 因此,讓我們從伺服器端開始。
ACRA是精心設計的,是相當受歡迎的(ACRA是針對客戶端應用的,服務端可以自己搭建)。 它允許開發者開發自己的伺服器系統,我們找到網上有很多種ACRA服務端。我建議選擇–也是最好的—Acralyzer,Acralyzer也是ACRA團隊開發的,Acralyzer工作在Apache CouchDB之上,所以除了CouchDB之外,沒有必要安裝任何額外的軟體。
Acralyzer是一個全功能的後端崩潰跟蹤系統。 從不同設備反饋回的同一堆棧跟蹤報告會被歸類為一個問題。如果你已經修復了某個問題,你可以通過簡單的點擊一下來關閉這個問題。同時它也是實時工作的。 這個系統我找到的唯一一個缺點就是他的界面有點復雜,但是無所謂啦,本來就是為開發者設計的嘛 =P。
安裝很簡單,下面是一個如何在Ubuntu上安裝Acralyzer的完整的指導。
首先從安裝couchdb開始,打開終端,輸入如下命令:
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs">apt-get install couchdb</code></code></code>
使用如下指令來驗證是否安裝成功
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs">curl http://127.0.0.1:5984</code></code></code></code>
如果安裝成功,會返回如下信息
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs"><code class="hljs json">{'couchdb':'Welcome','version':'1.2.0'}</code></code></code></code></code>
編輯/etc/couchdb/local.ini 文件來允許我們通過外部IP來訪問CouchDB(默認只能通關127.0.0.1來訪問)。只需要把下面兩行的注釋去掉即可。
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs"><code class="hljs json"><code class="hljs lisp">;port = 5984
2.;bind_address = 127.0.0.1</code></code></code></code></code></code>
然後修改為:
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs"><code class="hljs json"><code class="hljs lisp"><code class="hljs ini">port = 5984
2.bind_address = 0.0.0.0</code></code></code></code></code></code></code>
在這個文件里,你還應該添加一個用戶名/密碼來作為管理員賬戶,找到這一行(一般是在文件末尾):
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs"><code class="hljs json"><code class="hljs lisp"><code class="hljs ini"><codeclass="hljs json">[admins]</code></code></code></code></code></code></code></code>
在它的下一行添加一個 username=password形式的內容。例如:
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs"><code class="hljs json"><code class="hljs lisp"><code class="hljs ini"><codeclass="hljs json"><code class="hljs fix">nuuneoi = 12345</code></code></code></code></code></code></code></code></code>
不用擔心在這里寫明文密碼會不會有問題,一旦CouchDB重啟後,你的密碼會被自動哈希加密,並且是不可讀的
保存文件,通過下面的語句來重啟CouchDB:
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs"><code class="hljs json"><code class="hljs lisp"><code class="hljs ini"><codeclass="hljs json"><code class="hljs fix"><code class="hljs ruby">curl -X POST http://localhost:5984/_restart -H'Content-Type: application/json'
2.</code></code></code></code></code></code></code></code></code></code>
現在,你就可以通過瀏覽器來訪問CouchDB了,網頁服務被稱為Futon—CouchDB的界面後端。通過以下地址來打開瀏覽器:
view sourceprint?
1.<code class="hljs "><code class="hljs "><code class="hljs cs"><code class="hljs cs"><code class="hljs json"><code class="hljs lisp"><code class="hljs ini"><codeclass="hljs json"><code class="hljs fix"><code class="hljs ruby"><code class="hljs cs">http://<YOUR_SERVER_IP>:5984/_utils</code></code></code></code></code></code></code></code></code></code></code>
⑷ android studio中怎麼打包.so庫文件
首先在Android Studio工程的app目錄下創建整個jni目錄,jni目錄里寫Android.mk、Application.mk以及各類C/C++和匯編源文件。然後跟原來一樣,用ndk_build工具去編,然後工具會自動生成libs目錄,裡面還有每個你在Application.mk里所指定處理器架構的so文件。
完成之後,編輯你對應mole(類似eclipse中的project)目錄下的build.gradle文件,為其添加以下代碼:
[html] view plain
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
比如本人mole完整的build.gradle文件如下所示:
[html] view plain
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.example.way.aligesture"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':acra')
compile project(':hwdroid')
}
最後記得選中對應的mole右擊synchronize同步一下,以便使其生效。如下圖所示,mole目錄下回生成一個jniLibs目錄,再打包生成的apk就會帶上.so了。
⑸ 如何在Android程序中使用ACRA3
一、介紹(Introction)
ACRA 允許你的Android應用將崩潰報告以谷歌文檔電子表的形式進行發送。本教程將引導您在應用程序項目中安裝ACRA。
ACRA allows your Android application to send Crash Reports in a Google Docs spreadsheet. This tutorial will guide you in installing ACRA in your application project.
二、設置好你的項目(Setting-up your project)
按照以下步驟在現有的應用程序項目中安裝ACRA庫:
Step by step installation of the ACRA library in an existing application project:
下載acra庫( )並打開壓縮包
登錄到您的谷歌文檔帳戶
導入壓縮包中的 CrashReports-template.csv (acra-3.1.2/CrashReport/doc)
打開導入的文檔
按照自己的喜好重命名
在菜單上,單擊窗體/創建表單
為了啟動「保存」按鈕,請添加描述信息
如果您使用谷歌應用服務的私人領域,一定要取消選擇"Require yourdomain.com sign-in to
⑹ android 系統崩掉的時候怎麼獲取錯誤日誌
Logcat裡面有。如果你想自定義錯誤信息,可以考慮使用ACRA
https://github.com/ACRA/acra
用起來很方便,可以保存至文件,發送至指定的郵箱。