Skip to content

Commit

Permalink
Merge pull request #146 from amitshekhariitbhu/update
Browse files Browse the repository at this point in the history
Reduce library size
  • Loading branch information
amitshekhariitbhu authored Feb 18, 2019
2 parents e3c5471 + 6b4db14 commit d14adf9
Show file tree
Hide file tree
Showing 136 changed files with 2,214 additions and 451 deletions.
23 changes: 15 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Android Studio generated folders
captures/
.externalNativeBuild

# IntelliJ project files
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.idea/

# Misc
.DS_Store
/build
/captures
.externalNativeBuild
/.idea
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Change Log
==========

Version 1.0.5 *(2019-02-18)*
----------------------------

* Reduce size by taking out encrypted database library as a separate module
* New: Add support for database delete
* Changed compile to implementation
* Fix: Minor bug fixes


Version 1.0.4 *(2018-06-23)*
----------------------------

Expand Down Expand Up @@ -48,7 +57,7 @@ Version 0.5.0 *(2017-01-21)*

* New: Export DB
* New: Method to get DB version
* Fix: Fix prouard issue and other minor issues
* Fix: Fix proguard issue and other minor issues


Version 0.4.0 *(2016-11-29)*
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
56 changes: 39 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/Apache-2.0)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/amitshekhariitbhu/Android-Debug-Database/blob/master/LICENSE)

## Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications.
## Android Debug Database is a powerful library for debugging databases and shared preferences in Android applications

### Android Debug Database allows you to view databases and shared preferences directly in your browser in a very simple way.
### Android Debug Database allows you to view databases and shared preferences directly in your browser in a very simple way

### What can Android Debug Database do?

* See all the databases.
* See all the data in the shared preferences used in your application.
* Run any sql query on the given database to update and delete your data.
Expand All @@ -30,13 +31,22 @@

### All these features work without rooting your device -> No need of rooted device

### Check out another awesome library for fast and simple networking in Android.
### Check out another awesome library for fast and simple networking in Android

* [Fast Android Networking Library](https://github.com/amitshekhariitbhu/Fast-Android-Networking)

### Using Android Debug Database Library in your application

Add this to your app's build.gradle

```groovy
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
debugImplementation 'com.amitshekhar.android:debug-db:1.0.5'
```

Using the Android Debug Database with encrypted database

```groovy
debugImplementation 'com.amitshekhar.android:debug-db-encrypt:1.0.5'
```

Use `debugImplementation` so that it will only compile in your debug build and not in your release build.
Expand All @@ -50,10 +60,11 @@ That’s all, just start the application, you will see in the logcat an entry li
Now open the provided link in your browser.

Important:
- Your Android phone and laptop should be connected to the same Network (Wifi or LAN).
- If you are using it over usb, run `adb forward tcp:8080 tcp:8080`

Note : If you want use different port other than 8080.
* Your Android phone and laptop should be connected to the same Network (Wifi or LAN).
* If you are using it over usb, run `adb forward tcp:8080 tcp:8080`

Note : If you want use different port other than 8080.
In the app build.gradle file under buildTypes do the following change

```groovy
Expand All @@ -62,23 +73,25 @@ debug {
}
```




You will see something like this :

### Seeing values

<img src=https://raw.githubusercontent.com/amitshekhariitbhu/Android-Debug-Database/master/assets/debugdb.png >

### Editing values

<img src=https://raw.githubusercontent.com/amitshekhariitbhu/Android-Debug-Database/master/assets/debugdb_edit.png >

### Working with emulator
- Android Default Emulator: Run the command in the terminal - `adb forward tcp:8080 tcp:8080` and open http://localhost:8080
- Genymotion Emulator: Enable bridge from configure virtual device (option available in genymotion)

* Android Default Emulator: Run the command in the terminal - `adb forward tcp:8080 tcp:8080` and open http://localhost:8080
* Genymotion Emulator: Enable bridge from configure virtual device (option available in genymotion)

### Getting address with toast, in case you missed the address log in logcat

As this library is auto-initialize, if you want to get the address log, add the following method and call (we have to do like this to avoid build error in release build as this library will not be included in the release build) using reflection.

```java
public static void showDebugDBAddressLogToast(Context context) {
if (BuildConfig.DEBUG) {
Expand All @@ -95,7 +108,9 @@ public static void showDebugDBAddressLogToast(Context context) {
```

### Adding custom database files

As this library is auto-initialize, if you want to debug custom database files, add the following method and call

```java
public static void setCustomDatabaseFiles(Context context) {
if (BuildConfig.DEBUG) {
Expand All @@ -117,7 +132,9 @@ public static void setCustomDatabaseFiles(Context context) {
```

### Adding InMemory Room databases

As this library is auto-initialize, if you want to debug inMemory Room databases, add the following method and call

```java
public static void setInMemoryRoomDatabases(SupportSQLiteDatabase... database) {
if (BuildConfig.DEBUG) {
Expand All @@ -137,23 +154,27 @@ public static void setInMemoryRoomDatabases(SupportSQLiteDatabase... database) {
```

### Find this project useful ? :heart:

* Support it by clicking the :star: button on the upper right of this page. :v:

### TODO

* Simplify emulator issue [Issue Link](https://github.com/amitshekhariitbhu/Android-Debug-Database/issues/6)
* And of course many more features and bug fixes.

### [Check out Mindorks awesome open source projects here](https://mindorks.com/open-source-projects)

### Contact - Let's become friends
- [Twitter](https://twitter.com/amitiitbhu)
- [Github](https://github.com/amitshekhariitbhu)
- [Medium](https://medium.com/@amitshekhar)
- [Facebook](https://www.facebook.com/amit.shekhar.iitbhu)

* [Twitter](https://twitter.com/amitiitbhu)
* [GitHub](https://github.com/amitshekhariitbhu)
* [Medium](https://medium.com/@amitshekhar)
* [Facebook](https://www.facebook.com/amit.shekhar.iitbhu)

### License

```
Copyright (C) 2016 Amit Shekhar
Copyright (C) 2019 Amit Shekhar
Copyright (C) 2011 Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -170,5 +191,6 @@ public static void setInMemoryRoomDatabases(SupportSQLiteDatabase... database) {
```

### Contributing to Android Debug Database

All pull requests are welcome, make sure to follow the [contribution guidelines](CONTRIBUTING.md)
when you submit pull request.
17 changes: 0 additions & 17 deletions app/proguard-rules.pro

This file was deleted.

17 changes: 6 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* * Copyright (C) 2016 Amit Shekhar
* * Copyright (C) 2019 Amit Shekhar
* * Copyright (C) 2011 Android Open Source Project
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,27 +17,22 @@
*
*/

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}

allprojects {
repositories {
jcenter()
google()
jcenter()
}
}

Expand Down
48 changes: 48 additions & 0 deletions debug-db-base/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
*
* * Copyright (C) 2019 Amit Shekhar
* * Copyright (C) 2011 Android Open Source Project
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*/

apply plugin: 'com.android.library'

android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue("string", "PORT_NUMBER", "8080")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'android.arch.persistence.room:runtime:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

//apply from: 'debug-db-base-upload.gradle'
Loading

0 comments on commit d14adf9

Please sign in to comment.