0

i am using eclipse for android application development. i want to connect my android application to mysql database.

i search code from http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

and Log says

11-13 01:08:49.439: E/AndroidRuntime(1037): FATAL EXCEPTION: main
11-13 01:08:49.439: E/AndroidRuntime(1037): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.bhaapapp3/com.bhaapapp3.AllProductsActivity}; have you declared this activity in your AndroidManifest.xml?
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1628)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.app.Activity.startActivityForResult(Activity.java:3390)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.app.Activity.startActivityForResult(Activity.java:3351)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.app.Activity.startActivity(Activity.java:3587)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.app.Activity.startActivity(Activity.java:3555)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at com.bhaapapp3.MainActivity$1.onClick(MainActivity.java:34)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.view.View.performClick(View.java:4240)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.view.View$PerformClick.run(View.java:17721)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.os.Handler.handleCallback(Handler.java:730)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.os.Looper.loop(Looper.java:137)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at android.app.ActivityThread.main(ActivityThread.java:5103)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at java.lang.reflect.Method.invokeNative(Native Method)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at java.lang.reflect.Method.invoke(Method.java:525)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-13 01:08:49.439: E/AndroidRuntime(1037):     at dalvik.system.NativeStart.main(Native Method)
11-13 01:08:52.879: I/Process(1037): Sending signal. PID: 1037 SIG: 9

plz help me

and menifest file:

          <?xml version="1.0" encoding="utf-8"?>
            <manifest xmlns:android="http://schemas.android.com/apk/res/android"
              package="com.bhaapapp3"
               android:versionCode="1"
                    android:versionName="1.0" >

               <uses-sdk
                     android:minSdkVersion="8"
                       android:targetSdkVersion="18" />
                         <uses-permission android:name="android.permission.INTERNET"/>

             <application
                         android:allowBackup="true"
                  android:icon="@drawable/ic_launcher"
                  android:label="@string/app_name"
                  android:theme="@style/AppTheme" >
                    <activity
                     android:name="com.bhaapapp3.MainActivity"
                   android:label="@string/app_name" >
                    <intent-filter>
                         <action android:name="android.intent.action.MAIN" />

                          <category android:name="android.intent.category.LAUNCHER" />
                             </intent-filter>

                               <!-- All Product Activity -->
                         <activity
                        android:name=".AllProductsActivity"
                       android:label="All Products" >
                                </activity>

                           <!-- Add Product Activity -->
                          <activity
                         android:name=".NewProductActivity"
                            android:label="Add New Product" >
                            </activity>

                      <!-- Edit Product Activity -->
                         <activity
                            android:name=".EditProductActivity"
                            android:label="Edit Product" >
                                 </activity>

                             </activity>
                             </application>

                           </manifest>
sam
  • 337
  • 5
  • 17
  • Just as the error message said, have you declared the activity in your `AndroidManifest.xml`? Post your `AndroidManifest.xml` here. – Andrew T. Nov 13 '13 at 06:15
  • Even if you provided correct activity name in Manifest, you may use compatibility package and didn't export it. Here's [something related.](http://stackoverflow.com/q/17273218/1051783) – gunar Nov 13 '13 at 06:33
  • everything seems ok. clean your project and then try. may be it helps. – Sandeep Nov 13 '13 at 07:16
  • after run it showz unexpectedly stopped – sam Nov 13 '13 at 07:18

1 Answers1

0

Assuming, you do not have permissions set from your LogCat error description, here is my contents for my AndroidMainfest.xml file that has access to the internet:

<manifest xlmns:android...>
 ...
 <uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>

Other than that, you should be fine to download a file from the internet.

And if still this will not work for you, then i suggest you to view given Videos there by Ravi Tamada at AndroidHive.info

Android
  • 1,529
  • 1
  • 12
  • 27