0

Here's the problem : There's a button in a view. When user click that button, insert a column to a table happened. I have read tutorial to connect mysql to android but I still can't solve this problem. And I have search in google but still can't find. I hope there's solution to finish my problem...

View MAIN

<ImageView
    android:id="@+id/MAIN_tittle"
    android:layout_width="300dp"
    android:layout_height="115dp"
    android:scaleX="1.2"
    android:scaleY="1.2"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:src="@drawable/main_tittle" />

<ImageButton
    android:id="@+id/MAIN_play"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scaleX="0.7"
    android:scaleY="0.7"
    android:layout_below="@+id/MAIN_tittle"
    android:layout_centerHorizontal="true"
    android:background="@android:color/transparent"
    android:src="@drawable/main_play" />

CLASS MAIN

public class MainMenu extends Activity {
ImageButton playButton = (ImageButton) findViewById(R.id.MAIN_play);
ImageButton optionsButton = (ImageButton) findViewById(R.id.MAIN_options);
ImageButton quitButton = (ImageButton) findViewById(R.id.MAIN_quit);
ImageButton facebookButton = (ImageButton) findViewById(R.id.MAIN_facebook);
ImageButton twitterButton = (ImageButton) findViewById(R.id.MAIN_twitter);

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main_menu);
    //PROBLEM IN MANIFEST
    play(); 
    options(); 
    quit(); 
    goToFacebook(); 
    rating();   
}

private void play() {
    playButton.setOnClickListener( new View.OnClickListener() { 
        public void onClick(View v) 
        {  startActivity(new Intent("com.example.creativesnakeladder.CharactersChoice"));
            //this is area of codes which to insert a column in mysql database
        } 
    });
}
4
  • Please provide the relevant code you have produced so far. Commented Oct 30, 2013 at 14:56
  • @Qben I just read tutorial show data from mysql to android. And, the formula is add query in php not in java. Commented Oct 30, 2013 at 15:05
  • Do you have anything at all at time stage? Like the View and the Button just showing a Toast message when pressed. I get the impression you need to learn Android development in general, and not just the connection toward a database. Could be wrong though. :) Commented Oct 30, 2013 at 15:11
  • good though. sorry, make you waiting. because i must edit first Commented Oct 30, 2013 at 15:26

1 Answer 1

1

Android uses SQLite to manage "on-disk" persistence in the traditional sense. Here is the package summary as well as a recent tutorial. Once you understand the basics, you can move on to using something like ORMLite to abstract some of the boilerplate away for you.

Sign up to request clarification or add additional context in comments.

2 Comments

is there a manner to use mysql easily when people use mysql in development android app
No, I can't say that I know of anyone using mysql in an Android app instead of the provided SQLite. If you are truly needing MySQL for this, I'm not much help. Sorry :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.