久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <i id='CGa24'><tr id='CGa24'><dt id='CGa24'><q id='CGa24'><span id='CGa24'><b id='CGa24'><form id='CGa24'><ins id='CGa24'></ins><ul id='CGa24'></ul><sub id='CGa24'></sub></form><legend id='CGa24'></legend><bdo id='CGa24'><pre id='CGa24'><center id='CGa24'></center></pre></bdo></b><th id='CGa24'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CGa24'><tfoot id='CGa24'></tfoot><dl id='CGa24'><fieldset id='CGa24'></fieldset></dl></div>

    <small id='CGa24'></small><noframes id='CGa24'>

  1. <legend id='CGa24'><style id='CGa24'><dir id='CGa24'><q id='CGa24'></q></dir></style></legend>

    1. <tfoot id='CGa24'></tfoot>
        <bdo id='CGa24'></bdo><ul id='CGa24'></ul>
    2. 基本操作中的 Android Amazon DynamoDb 錯(cuò)誤

      Android Amazon DynamoDb error in basic action(基本操作中的 Android Amazon DynamoDb 錯(cuò)誤)
        <tbody id='We3WV'></tbody>

                <bdo id='We3WV'></bdo><ul id='We3WV'></ul>

              • <i id='We3WV'><tr id='We3WV'><dt id='We3WV'><q id='We3WV'><span id='We3WV'><b id='We3WV'><form id='We3WV'><ins id='We3WV'></ins><ul id='We3WV'></ul><sub id='We3WV'></sub></form><legend id='We3WV'></legend><bdo id='We3WV'><pre id='We3WV'><center id='We3WV'></center></pre></bdo></b><th id='We3WV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='We3WV'><tfoot id='We3WV'></tfoot><dl id='We3WV'><fieldset id='We3WV'></fieldset></dl></div>
              • <tfoot id='We3WV'></tfoot>

                <small id='We3WV'></small><noframes id='We3WV'>

              • <legend id='We3WV'><style id='We3WV'><dir id='We3WV'><q id='We3WV'></q></dir></style></legend>
                本文介紹了基本操作中的 Android Amazon DynamoDb 錯(cuò)誤的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我正在嘗試構(gòu)建一個(gè)可以與 Amazon DynamoDB 交互的簡單 Android 應(yīng)用程序.我已經(jīng)下載了最新的 Android Studio 和 AWS 移動(dòng) SDK.我現(xiàn)在要做的只是在我的表客戶"中插入一行.但是,當(dāng)我運(yùn)行該應(yīng)用程序時(shí),我遇到以下錯(cuò)誤.如果你們能幫我看一下,我會非常感激,如果我犯了一些愚蠢的錯(cuò)誤,我會很抱歉.(我已經(jīng)按照文檔設(shè)置識別池,創(chuàng)建新策略,將東西放入 AsyncTask..等)

                I am trying to build a simple android app that can interact with Amazon DynamoDB. I have download the latest Android Studio and also AWS mobile SDK. What I am trying to do now is simply insert a row into my table "customer". However when I run the app I encounter the following error. Would really appreciate if you guys can help me take a look and sorry if I make some stupid mistakes.(I have follow the doc to set up identification pool, create new policy, put stuff in AsyncTask..etc)

                謝謝,

                錯(cuò)誤

                07-21 23:31:59.781    4207-4234/com.example.an.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
                Process: com.example.an.myapplication, PID: 4207
                java.lang.RuntimeException: An error occured while executing doInBackground()
                        at android.os.AsyncTask$3.done(AsyncTask.java:304)
                        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
                        at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
                        at java.util.concurrent.FutureTask.run(FutureTask.java:242)
                        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                        at java.lang.Thread.run(Thread.java:818)
                 Caused by: com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMappingException: No interface com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBHashKey annotation found in class class com.example.an.myapplication.customers
                        at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.needAutoGenerateAssignableKey(DynamoDBMapper.java:720)
                        at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.save(DynamoDBMapper.java:780)
                        at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.save(DynamoDBMapper.java:688)
                        at com.example.an.myapplication.MainActivity$db.doInBackground(MainActivity.java:67)
                        at com.example.an.myapplication.MainActivity$db.doInBackground(MainActivity.java:56)
                        at android.os.AsyncTask$2.call(AsyncTask.java:292)
                        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                        at java.lang.Thread.run(Thread.java:818)
                

                MainActivity.java

                package com.example.an.myapplication;
                import android.content.Context;
                import android.os.AsyncTask;
                import android.support.v7.app.ActionBarActivity;
                import android.os.Bundle;
                import android.util.Log;
                import android.view.Menu;
                import android.view.MenuItem;
                import com.amazonaws.auth.CognitoCachingCredentialsProvider;
                import com.amazonaws.regions.Regions;
                import com.amazonaws.services.dynamodbv2.*;
                import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.*;
                
                
                
                public class MainActivity extends ActionBarActivity {
                private CognitoCachingCredentialsProvider credentialsProvider;
                private static final String TAG = MainActivity.class.getSimpleName();
                
                
                @Override
                protected void onCreate(Bundle savedInstanceState) {
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.activity_main);
                
                    credentialsProvider = new CognitoCachingCredentialsProvider(
                            this.getApplicationContext(),    /* get the context for the current activity */
                            "us-east-1:ef8bfc69-88b7-4714-ae0a-223f08a20fe5", // Identity Pool ID
                            Regions.US_EAST_1 // Region
                    );
                    new db().execute("");
                }
                
                @Override
                public boolean onCreateOptionsMenu(Menu menu) {
                    // Inflate the menu; this adds items to the action bar if it is present.
                    getMenuInflater().inflate(R.menu.menu_main, menu);
                    return true;
                }
                
                @Override
                public boolean onOptionsItemSelected(MenuItem item) {
                    // Handle action bar item clicks here. The action bar will
                    // automatically handle clicks on the Home/Up button, so long
                    // as you specify a parent activity in AndroidManifest.xml.
                    int id = item.getItemId();
                
                    //noinspection SimplifiableIfStatement
                    if (id == R.id.action_settings) {
                        return true;
                    }
                
                    return super.onOptionsItemSelected(item);
                }
                
                private class db extends AsyncTask<String, Void, String> {
                    @Override
                    protected String doInBackground(String... params) {
                
                        AmazonDynamoDBClient ddbClient = new AmazonDynamoDBClient(credentialsProvider);
                        DynamoDBMapper mapper = new DynamoDBMapper(ddbClient);
                        customers customer = new customers();
                        customer.setCustomerID("GG");
                        customer.setBalance(5);
                        mapper.save(customer);
                        return "Executed";
                    }
                
                    @Override
                    protected void onPostExecute(String result) {}
                
                    @Override
                    protected void onPreExecute() {}
                
                    @Override
                    protected void onProgressUpdate(Void... values) {}
                }
                }
                

                customer.java

                package com.example.an.myapplication;
                import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.*;
                
                
                @DynamoDBTable(tableName = "customer")
                public class customers {
                private String id;
                private int balance;
                
                @DynamoDBIndexHashKey(attributeName = "CustomerID")
                public String getCustomerID() {
                    return id;
                }
                
                public void setCustomerID(String id) {
                    this.id = id;
                }
                
                @DynamoDBAttribute(attributeName = "Balance")
                public int getBalance() {
                    return balance;
                }
                
                public void setBalance(int balance) {
                    this.balance = balance;
                }
                }
                

                推薦答案

                我終于在亞馬遜支持的幫助下解決了這個(gè)問題

                I finally fix the problem with the help of Amazon support

                In customers.java, you don't have an attribute annotated with DynamoDBHashKey.
                Not sure how your DynamoDB table is set up. At minimum, it needs a hash key.
                If CustomerID is the hash key, then you need to change of the annotation of id
                from DynamoDBIndexHashKey to DynamoDBHashKey.
                

                結(jié)果我使用@DynamoDBIndexHashKey 而不是@DynamoDBHashKey!改正后就可以了!

                So it turn out I use @DynamoDBIndexHashKey instead of @DynamoDBHashKey! After correcting that it works!

                這篇關(guān)于基本操作中的 Android Amazon DynamoDb 錯(cuò)誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                Get current location during app launch(在應(yīng)用啟動(dòng)期間獲取當(dāng)前位置)
                locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)
              • <i id='rA0TT'><tr id='rA0TT'><dt id='rA0TT'><q id='rA0TT'><span id='rA0TT'><b id='rA0TT'><form id='rA0TT'><ins id='rA0TT'></ins><ul id='rA0TT'></ul><sub id='rA0TT'></sub></form><legend id='rA0TT'></legend><bdo id='rA0TT'><pre id='rA0TT'><center id='rA0TT'></center></pre></bdo></b><th id='rA0TT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rA0TT'><tfoot id='rA0TT'></tfoot><dl id='rA0TT'><fieldset id='rA0TT'></fieldset></dl></div>

                      <tbody id='rA0TT'></tbody>

                    <tfoot id='rA0TT'></tfoot>

                        <bdo id='rA0TT'></bdo><ul id='rA0TT'></ul>

                        1. <legend id='rA0TT'><style id='rA0TT'><dir id='rA0TT'><q id='rA0TT'></q></dir></style></legend>

                          <small id='rA0TT'></small><noframes id='rA0TT'>

                        2. 主站蜘蛛池模板: 久草福利资源站 | 日韩在线免费播放 | 亚洲欧美综合另类 | 日韩免费一级片 | 最新中文字幕在线 | 日本不卡一区 | 美女黄色一级片 | 久久香蕉国产 | 亚洲成人av在线播放 | av在线免费观看网站 | 天天干影院 | 伊人春色在线 | 欧美日韩免费视频 | 国产一区二区三区四区 | 激情五月激情综合网 | 欧美黄色一级 | 欧美激情视频一区二区三区 | 免费看大片a| 国产精品自拍小视频 | 国产免费高清视频 | 午夜免费福利视频 | 蜜桃综合网 | 亚洲综合激情网 | 麻豆精品一区 | 伊人91| 日韩av在线免费播放 | 国产精品第一区 | 亚洲精品视频免费观看 | 伊人av在线 | 国产精品毛片一区二区在线看 | 欧美日韩综合网 | 高潮毛片7777777毛片 | 中文字幕在线看片 | 中文字幕在线观看免费视频 | 精品国产乱码久久久久 | 久久伊人国产 | 亚洲91视频 | 欧美黄色一级 | 黄a视频 | 在线播放国产精品 | 日本黄色视 |