Soru & Cevap

Azure Mobile Services Kullandığım Android Uygulamam Çöküyor

02.01.2015 - 06:39

Merhaba,

Uygulamamda Azure Mobile Services kullanmak için bir test uygulaması yazdım. Fakat uygulama patlıyor maalesef. LogCat çıktısı;

01-02 16:26:44.908: E/Trace(623): error opening trace file: No such file or directory (2)
01-02 16:26:45.078: W/dalvikvm(623): VFY: unable to find class referenced in signature (Lcom/microsoft/windowsazure/mobileservices/MobileServiceClient;)
01-02 16:26:45.088: E/dalvikvm(623): Could not find class 'com.microsoft.windowsazure.mobileservices.MobileServiceClient', referenced from method com.example.liklink.MainActivity.onCreate
01-02 16:26:45.088: W/dalvikvm(623): VFY: unable to resolve new-instance 1124 (Lcom/microsoft/windowsazure/mobileservices/MobileServiceClient;) in Lcom/example/liklink/MainActivity;
01-02 16:26:45.088: D/dalvikvm(623): VFY: replacing opcode 0x22 at 0x0008
01-02 16:26:45.098: D/dalvikvm(623): DexOpt: unable to opt direct call 0x1ec1 at 0x0e in Lcom/example/liklink/MainActivity;.onCreate
01-02 16:26:45.228: D/AndroidRuntime(623): Shutting down VM
01-02 16:26:45.228: W/dalvikvm(623): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
01-02 16:26:45.238: E/AndroidRuntime(623): FATAL EXCEPTION: main
01-02 16:26:45.238: E/AndroidRuntime(623): java.lang.NoClassDefFoundError: com.microsoft.windowsazure.mobileservices.MobileServiceClient
01-02 16:26:45.238: E/AndroidRuntime(623):     at com.example.liklink.MainActivity.onCreate(MainActivity.java:29)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.app.Activity.performCreate(Activity.java:5008)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.os.Looper.loop(Looper.java:137)
01-02 16:26:45.238: E/AndroidRuntime(623):     at android.app.ActivityThread.main(ActivityThread.java:4745)
01-02 16:26:45.238: E/AndroidRuntime(623):     at java.lang.reflect.Method.invokeNative(Native Method)
01-02 16:26:45.238: E/AndroidRuntime(623):     at java.lang.reflect.Method.invoke(Method.java:511)
01-02 16:26:45.238: E/AndroidRuntime(623):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
01-02 16:26:45.238: E/AndroidRuntime(623):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
01-02 16:26:45.238: E/AndroidRuntime(623):     at dalvik.system.NativeStart.main(Native Method)

 

MainActivity.java

package com.example.liklink;
import java.net.MalformedURLException;

import android.app.Activity;

import com.microsoft.windowsazure.mobileservices.*;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {
    private MobileServiceClient mClient;
    
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        
        
        
        try {
            mClient = new MobileServiceClient(
                      "MobileServiceURL",
                      "MobileServiceKey",
                      this
                );
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
        
        Button btn = (Button)findViewById(R.id.button1);
        btn.setOnClickListener(new View.OnClickListener() {
            
             public void onClick(View v) {
                 EditText txt = (EditText)findViewById(R.id.editText1);
                 android item = new android();
                    item.Text = txt.getText().toString();
                    mClient.getTable(android.class).insert(item, new TableOperationCallback<android>() {
                          public void onCompleted(android entity, Exception exception, ServiceFilterResponse response)
                          {
                               
                              Toast.makeText(MainActivity.this, "İşlem Başarılı", Toast.LENGTH_SHORT).show();
                              
                                if (exception == null) {
                                      
                                } else {
                                     
                                }
                          }
                    });
                 
             }
            
        });
        
        
    }

    
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.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();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

 

android.java class'ım

 

package com.example.liklink;

public class android {
  
    
    public String Id;
    public String Text;
    
    
    
}

 

Şimdiden çok teşekkür ederim. 

 

 

5 Görüntülenme

1 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-7617-1421911538.jpg
sametgunduz
05.01.2015 - 03:48

Eklemiş oldugunuz referans dosyalarını vs. kontrol ederek tekrar denemenizde fayda var. 
Azure'un android için sample projelerini inceleyerekte problemi çözebilirsiniz.