Giter Site home page Giter Site logo

databasemanager_for_android's Introduction

DatabaseManager_For_Android

Managing Android apps' SQLite databases is tough while developing. You cannot view the tables, you don't know what is getting inserted into the tables and you can't update the data and see how your application responds to it.

What if you had a database manager like oracle sqldevelopr, mysql work bench for your application's SQLite database? This library gives you that.

With this library you can manage the database of your android app from the app itself.

You can view, insert, delete, update the tables of your app's SQLite database from your app.

Then entire library is written into a single Activity class so you just need to add this Activity to your Android app.

This is how it looks - watch this 1 minute video for demo : http://youtu.be/P5vpaGoBlBY?t=3m40s

Setup:

Setup takes hardly 3 minutes. Just follow the four simple steps below:

You can watch 3 mins demonstration video here : http://youtu.be/P5vpaGoBlBY where I setup this library for my app.

  1. Clone or download this repository and add AndroidDatabaseManager.java file to your application.

    at lines 54 and 73 change yourSqlliteopenhelper to the class name of your custom SQLiteOpenHelper class i.e, the class which you are using to create tables, insert data to your app SQLite database.

    After changing the name, some errors will exist! don't worry, they will be gone after the next step.

  2. Open helperFunction.txt file copy the entire text and paste the function in you custom SQLiteOpenHelper class .i.e, the class which you are using to create tables and insert data to your app's SQLite database.

    If there is a compile error at MatrixCursor, add import android.database.MatrixCursor; statement at the start of your class file

  3. Add the following code to your android manifest .Enter the name of the package where AndroidDatabaseManager.java is located.

  4. Now you have to start the AndroidDatabaseManager activity . You can do this anyway you wish,Below 3 are the simple ways to start the activity choose anyone as per your convenience.

    (i) add OnClickListener to a TextView. You can use the textview which is already present in your layout or add a TextView element to your xml.

    TextView tv =(TextView)findViewById(R.id.yourtextviewid);
     	
    tv.setOnClickListener(new OnClickListener() {
     		public void onClick(View v) {
    
       Intent dbmanager = new Intent(getActivity(),AndroidDatabaseManager.class);
     		startActivity(dbmanager);
          }
     	});
    

(ii) add OnClickListener to a Button. You can use the button which is already present in your layout or add a Button element to your xml.

   Button button =(Button)findViewByID(R.id.yourbuttonid);
    	
   button.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {

      Intent dbmanager = new Intent(getActivity(),AndroidDatabaseManager.class);
			startActivity(dbmanager);
         }
		});

(iii) If you are using an action bar add an item to the action bar and start activity when action bar item is clicked.

That's it. Now you can manage your application database directly from your app.

When app development is done remove the activity and publish your app.

With this library you can do all these :

1) View all your tables data in tabular format
2) Insert rows to your tables
3) Update rows
4) Delete rows
5) Delete tables
6) Drop tables
7) Write your own custom queries and view the results. (Create statements, joins, etc)
8) Change data in the tables and see how you application responds

In a nut shell, you can manage your app database easily.

databasemanager_for_android's People

Contributors

abdellahbenhammou avatar intrications avatar sanathp avatar sivakumar-raja avatar thomasfischersm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.