zoukankan      html  css  js  c++  java
  • ACRA 报告-formkey(转)

    一、创建google doc form,用于保存错误报告;

            1.https://drive.google.com/?authuser=0#my-drive 登录账户;

            2.在#my-drive 创建spreadsheets和form并不能拿到formkey,在此提供一个链接方便大家去创建一个可用的form;

                https://docs.google.com/spreadsheet/viewform?formkey=dGdTZEFieDRncHZwT3hpWk9icjloeHc6MQ

                点击该链接,在弹出的网页中点击submit,成功后在在返回的界面上点击Create my own form

            3. 获取formkey,在新建的form页面中点击菜单中的form,选择Embed from in a webpage...,在弹出的窗口中即可拿到formkey

    二、https://github.com/ACRA/acra  下载源码 acra-4.5.0RC2

           省略拿formkey的步骤,按照https://github.com/ACRA/acra/wiki/BasicSetup配置基本可以集成好可以使用的环境

    三、集成后,运行会出现一些错误,在此罗列一下如何修改;

            1.发送不成功,出现invalid set cookie attribute;

             解决方法:修改文件,HttpRequest 152行增加以下两行

                httpClient.getParams().setParameter("http.protocol.single-cookie-header",true);

                HttpClientParams.setCookiePolicy( httpClient.getParams(), CookiePolicy.BROWSER_COMPATIBILITY);

                response = httpClient.execute(httpRequest, new BasicHttpContext());

             2.发送成功,google 服务器会返回如下信息

            HttpResponse Content : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-type" content="text/html; charset=utf-8">
    04-27 17:26:56.790: D/ACRA(25162): <title>****</title>
    04-27 17:26:56.790: D/ACRA(25162): <link href='/static/spreadsheets/client/css/627030122-form_response_compiled.css' type='text/css' rel='stylesheet'>
    04-27 17:26:56.790: D/ACRA(25162): <style type="text/css">
    04-27 17:26:56.790: D/ACRA(25162):       .ss-logo {background:transparent url("https://ssl.gstatic.com/docs/spreadsheets/forms/sprites_2.png") no-repeat}
    04-27 17:26:56.790: D/ACRA(25162):     </style></head>
    04-27 17:26:56.790: D/ACRA(25162): <body><div class="ss-container"><div class="ss-resp-card"><div class="ss-confirmation">android bizcard crash form</div>
    04-27 17:26:56.790: D/ACRA(25162): <div class="ss-custom-resp">Your response has been recorded.</div>
    04-27 17:26:56.790: D/ACRA(25162): <div class="ss-opt-actions">
    04-27 17:26:56.790: D/ACRA(25162): </div>
    04-27 17:26:56.790: D/ACRA(25162): <hr class="ss-break">
    04-27 17:26:56.790: D/ACRA(25162): <div class="ss-footer"><div class="ss-footer-txt"><a class="ss-actions-link" href="https://docs.google.com/spreadsheet/viewform?formkey=dFBEVDhnOFA2R21nSGhYYXhvUXByYXc6MQ&amp;ifq">別の回答を送信</a>
    04-27 17:26:56.790: D/ACRA(25162): |
    04-27 17:26:56.790: D/ACRA(25162): <a class="ss-actions-link" href="https://docs.google.com/spreadsheet/newform?ref=submitpage">フォームを作成</a></div>
    04-27 17:26:56.790: D/ACRA(25162): <a class="ss-logo-link" href="https://docs.google.com/"><div class="ss-logo">&nbsp;&nbsp

           3.如果出现form表单中显示的数据项不正确,没有显示,或者显示的位置不对

             解决方法:详见http://blog.dfarooq.com/2012/10/using-google-spreadsheets-as-database.html

                                 要保证form表单源码中定义的输入框id 类似entry.2.single,要和acra-4.5.0RC2源码中保持一致;

  • 相关阅读:
    bzoj 2259 [Oibh]新型计算机 ——最短路(建图)
    bzoj 4555 [Tjoi2016&Heoi2016]求和——NTT+第二类斯特林数
    NOIp2018 D2T3 defense——树上倍增
    bzoj 3456 城市规划——分治FFT / 多项式求逆 / 多项式求ln
    洛谷 4721 【模板】分治 FFT——分治FFT / 多项式求逆
    bzoj 3625(CF 438E)The Child and Binary Tree——多项式开方
    洛谷 P3377 模板左偏树
    CF 1016 C —— 思路
    洛谷 P3806 点分治模板
    洛谷 P4149 [ IOI 2011 ] Race —— 点分治
  • 原文地址:https://www.cnblogs.com/weixiao870428/p/3512389.html
Copyright © 2011-2022 走看看