├── .gitignore ├── LICENSE ├── README.md ├── android-module └── androiddbviewer │ ├── .gitignore │ ├── androiddbviewer.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── clough │ │ └── android │ │ └── androiddbviewer │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── clough │ │ │ └── android │ │ │ └── androiddbviewer │ │ │ ├── ADBVApplication.java │ │ │ └── Data.java │ └── res │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── clough │ └── android │ └── androiddbviewer │ └── ExampleUnitTest.java ├── images ├── 1.png ├── 10.png ├── 11.png ├── 12.png ├── 13.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png ├── 9.png ├── application.png └── application_icon.png ├── netbeans-project └── AndroidDBvieweR │ ├── assets │ ├── adb │ │ ├── linux │ │ │ └── adb │ │ ├── mac │ │ │ └── adb │ │ └── windows │ │ │ ├── AdbWinApi.dll │ │ │ ├── AdbWinUsbApi.dll │ │ │ └── adb.exe │ └── icons │ │ ├── application_icon.png │ │ ├── application_icon_2.png │ │ ├── asdasd.png │ │ ├── blue.png │ │ ├── database.png │ │ ├── green.png │ │ ├── hash_tag.png │ │ ├── orange.png │ │ ├── pencil.png │ │ └── sql_table.png │ ├── build.xml │ ├── build │ ├── built-jar.properties │ └── classes │ │ ├── adb │ │ ├── linux │ │ │ └── adb │ │ ├── mac │ │ │ └── adb │ │ └── windows │ │ │ ├── AdbWinApi.dll │ │ │ ├── AdbWinUsbApi.dll │ │ │ └── adb.exe │ │ └── icons │ │ ├── application_icon.png │ │ ├── application_icon_2.png │ │ ├── asdasd.png │ │ ├── blue.png │ │ ├── database.png │ │ ├── green.png │ │ ├── hash_tag.png │ │ ├── orange.png │ │ ├── pencil.png │ │ └── sql_table.png │ ├── lib │ ├── JTattoo-1.6.11.jar │ ├── org.json-20120521.jar │ └── wagu.jar │ ├── manifest.mf │ ├── nbproject │ ├── build-impl.xml │ ├── genfiles.properties │ ├── private │ │ ├── config.properties │ │ ├── private.properties │ │ └── private.xml │ ├── project.properties │ └── project.xml │ └── src │ └── com │ └── clough │ └── android │ └── adbv │ ├── Launcher.java │ ├── controller │ └── RowController.java │ ├── exception │ ├── ADBManagerException.java │ ├── HistoryManagerException.java │ └── IOManagerException.java │ ├── manager │ ├── ADBManager.java │ ├── HistoryManager.java │ └── IOManager.java │ ├── model │ ├── Data.java │ ├── Field.java │ └── Row.java │ ├── util │ ├── TableColumnAdjuster.java │ ├── TableEditor.java │ └── ValueHolder.java │ └── view │ ├── AddUpdateRowDialog.form │ ├── AddUpdateRowDialog.java │ ├── CreateTableDialog.form │ ├── CreateTableDialog.java │ ├── HistoryItemPanel.form │ ├── HistoryItemPanel.java │ ├── MainFrame.form │ ├── MainFrame.java │ ├── TextOutputDialog.form │ ├── TextOutputDialog.java │ ├── UpdateTableDialog.form │ ├── UpdateTableDialog.java │ ├── WaitingDialog.form │ ├── WaitingDialog.java │ ├── WaitingForDeviceDialog.form │ └── WaitingForDeviceDialog.java └── sample-app └── ADBVTestApp ├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── clough │ │ └── android │ │ └── adbvtestapp │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── clough │ │ │ └── android │ │ │ └── adbvtestapp │ │ │ ├── CustomApplication.java │ │ │ ├── DatabaseHelper.java │ │ │ └── MainActivity.java │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── clough │ └── android │ └── adbvtestapp │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | *.jar 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | /netbeans-project/AndroidDBvieweR/dist/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AndroidDBvieweR 2 | 3 | ![Application](http://i.imgur.com/UMWxifj.gif) 4 | 5 | ## About 6 | 7 | AndroidDBvieweR is a desktop application for monitoring and managing databases of android applications. There are two main features of this application. 8 | 9 | * **No need your device to be ROOTED** 10 | * **No need of importing app's database file (Ex: app_database.db)** 11 | 12 | Click [here](https://github.com/thedathoudarya/AndroidDBvieweR/files/158724/AndroidDBvieweR-v1.0.1.zip) to download AndroidDBvieweR desktop application. 13 | 14 | ## How it works 15 | 16 | AndroidDBvieweR connects with android apps through a socket connection. This socket connection is being established with the help of the **android debugger bridge (adb)**. AndroidDBvieweR won't connect with an android app, unless it is a configured app. 17 | 18 | ## Configuration 19 | 20 | ### Step 1 21 | 22 | Add following dependencies to your app's `build.gradle` file. 23 | 24 | **Set gradle dependency from repository,** 25 | ```GRADLE 26 | dependencies { 27 | compile 'com.clough.android.androiddbviewer:androiddbviewer:1.0.0' 28 | } 29 | ``` 30 | **or, add as a java library** 31 | 32 | Download **androiddbviewer.jar** from [here](https://github.com/thedathoudarya/AndroidDBvieweR/files/158725/androiddbviewer.zip) and place it in your project's `lib` folder. 33 | 34 | ```GRADLE 35 | dependencies { 36 | compile files ('lib/androiddbviewer.jar') 37 | } 38 | ``` 39 | Build your project. 40 | 41 | ### Step 2 42 | 43 | Create a custom `SQLiteOpenHelper` for your app's database operations, or you can stick to your own custom `SQLiteOpenHelper`. (Going to be needed in **step 3**) 44 | 45 | ```JAVA 46 | public class DatabaseHelper extends SQLiteOpenHelper { 47 | public DatabaseHelper(Context context) { 48 | super(context, "test_db", null, 1); 49 | } 50 | 51 | @Override 52 | public void onCreate(SQLiteDatabase db) { 53 | // create tables 54 | } 55 | 56 | @Override 57 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 58 | // drop, alter tables 59 | } 60 | } 61 | ``` 62 | ## Step 3 63 | 64 | Create a custom `Application`. Use abstract class `ADBVApplication`, instead of the android `Application`. (a sub class of the android `Application` class) . 65 | 66 | ```JAVA 67 | public class CustomApplication extends ADBVApplication { 68 | 69 | @Override 70 | public SQLiteOpenHelper getDataBase() { 71 | return new DatabaseHelper(getApplicationContext()); 72 | } 73 | 74 | } 75 | ``` 76 | 77 | ## Step 4 78 | 79 | Add `INTERNET` permission in `AndroidManifest.xml` file. And also add your custom `Application` class name as the value for the `name` attribute in `` tag. The final code should look like this. 80 | 81 | ```XML 82 | 83 | 85 | 86 | 87 | 88 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | ``` 104 | 105 | ## Finalizing 106 | * Connect your device to your computer 107 | * Run **AndroidDBvieweR** desktop application 108 | * Start your android app 109 | 110 | ## Make sure, 111 | 112 | * You have enabled the **usb debugging** option of the device and, 113 | * JAVA version of the computer is equal or higher that 1.6 114 | 115 | ## FYI 116 | 117 | If you have a trouble establishing Android USB debug connection, there is an application called [PdaNet](http://pdanet.co/) which enables the USB debugger connection between your computer and android device. 118 | 119 | Application screenshots can be found in [here](https://github.com/thedathoudarya/AndroidDBvieweR/wiki/Screenshots) 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /android-module/androiddbviewer/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android-module/androiddbviewer/androiddbviewer.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /android-module/androiddbviewer/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.jfrog.bintray' 3 | apply plugin: 'com.github.dcendents.android-maven' 4 | 5 | group = 'com.clough.android.androiddbviewer' 6 | version = '1.0.0' 7 | 8 | android { 9 | compileSdkVersion 23 10 | buildToolsVersion "23.0.2" 11 | 12 | defaultConfig { 13 | minSdkVersion 14 14 | targetSdkVersion 23 15 | versionCode 1 16 | versionName "1.0" 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | } 26 | 27 | dependencies { 28 | compile fileTree(dir: 'libs', include: ['*.jar']) 29 | testCompile 'junit:junit:4.12' 30 | compile 'com.android.support:appcompat-v7:23.2.0' 31 | } 32 | 33 | task generateSourcesJar(type: Jar) { 34 | from android.sourceSets.main.java.srcDirs 35 | classifier 'sources' 36 | } 37 | 38 | task generateJavadocs(type: Javadoc) { 39 | source = android.sourceSets.main.java.srcDirs 40 | classpath += project.files(android.getBootClasspath() 41 | .join(File.pathSeparator)) 42 | } 43 | 44 | task generateJavadocsJar(type: Jar) { 45 | from generateJavadocs.destinationDir 46 | classifier 'javadoc' 47 | } 48 | 49 | generateJavadocsJar.dependsOn generateJavadocs 50 | 51 | artifacts { 52 | archives generateJavadocsJar 53 | archives generateSourcesJar 54 | } 55 | 56 | bintray { 57 | user = 'clough' 58 | key = '65e3976cfae72927b4f15d9b4cd8ee16d60b6097' 59 | pkg { 60 | repo = 'maven' 61 | name = 'android-db-viewer' 62 | 63 | version { 64 | name = 'AndroidDBvieweR' 65 | desc = 'This is the first version' 66 | released = new Date() 67 | vcsTag = '1.0.0' // the version 68 | } 69 | 70 | licenses = ['Apache-2.0'] 71 | vcsUrl = 'https://github.com/thedathoudarya/AndroidDBvieweR.git' 72 | websiteUrl = 'https://github.com/thedathoudarya/AndroidDBvieweR' 73 | } 74 | configurations = ['archives'] 75 | } -------------------------------------------------------------------------------- /android-module/androiddbviewer/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Thedath Oudarya\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /android-module/androiddbviewer/src/androidTest/java/com/clough/android/androiddbviewer/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.clough.android.androiddbviewer; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /android-module/androiddbviewer/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android-module/androiddbviewer/src/main/java/com/clough/android/androiddbviewer/Data.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.androiddbviewer; 18 | 19 | import org.json.JSONException; 20 | import org.json.JSONObject; 21 | 22 | /** 23 | * Created by thedathoudarya on 1/11/16. 24 | */ 25 | public class Data { 26 | 27 | public static final int LIVE_CONNECTION = 0; 28 | 29 | public static final int QUERY = 1; 30 | 31 | public static final int CONNECTION_REQUEST = 2; 32 | 33 | public static final int CONNECTION_ACCEPTED = 3; 34 | 35 | public static final int DEVICE_NAME = 4; 36 | 37 | public static final int APPLICATION_ID = 5; 38 | 39 | public static final int DATABASE_NAME = 6; 40 | 41 | private int status; 42 | 43 | private String query; 44 | 45 | private String result; 46 | 47 | public Data() { 48 | } 49 | 50 | public Data(JSONObject dataJSONObject) throws JSONException { 51 | parseData(dataJSONObject); 52 | } 53 | 54 | public Data(int status, String request, String response) { 55 | this.status = status; 56 | this.query = request; 57 | this.result = response; 58 | } 59 | 60 | public int getStatus() { 61 | return status; 62 | } 63 | 64 | public Data setStatus(int status) { 65 | this.status = status; 66 | return this; 67 | } 68 | 69 | public String getQuery() { 70 | return query; 71 | } 72 | 73 | public Data setQuery(String query) { 74 | this.query = query; 75 | return this; 76 | } 77 | 78 | public String getResult() { 79 | return result; 80 | } 81 | 82 | public Data setResult(String result) { 83 | this.result = result; 84 | return this; 85 | } 86 | 87 | public JSONObject toJSON() { 88 | try { 89 | return new JSONObject() 90 | .put("status", status) 91 | .put("query", query) 92 | .put("result", result); 93 | } catch (JSONException ex) { 94 | return null; 95 | } 96 | } 97 | 98 | public Data parseData(JSONObject dataJSON) throws JSONException { 99 | this 100 | .setStatus(dataJSON.getInt("status")) 101 | .setQuery(dataJSON.getString("query")) 102 | .setResult(dataJSON.getString("result")); 103 | 104 | return this; 105 | } 106 | 107 | @Override 108 | public int hashCode() { 109 | int hash = 7; 110 | hash = 53 * hash + this.status; 111 | hash = 53 * hash + (this.query != null ? this.query.hashCode() : 0); 112 | hash = 53 * hash + (this.result != null ? this.result.hashCode() : 0); 113 | return hash; 114 | 115 | } 116 | 117 | @Override 118 | public boolean equals(Object obj) { 119 | if (obj == null) { 120 | return false; 121 | } 122 | if (getClass() != obj.getClass()) { 123 | return false; 124 | } 125 | final Data other = (Data) obj; 126 | if (this.status != other.status) { 127 | return false; 128 | } 129 | if ((this.query == null) ? (other.query != null) : !this.query.equals(other.query)) { 130 | return false; 131 | } 132 | if ((this.result == null) ? (other.result != null) : !this.result.equals(other.result)) { 133 | return false; 134 | } 135 | return true; 136 | } 137 | 138 | } 139 | 140 | -------------------------------------------------------------------------------- /android-module/androiddbviewer/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AndroidDbvieweR 3 | 4 | -------------------------------------------------------------------------------- /android-module/androiddbviewer/src/test/java/com/clough/android/androiddbviewer/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.clough.android.androiddbviewer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/1.png -------------------------------------------------------------------------------- /images/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/10.png -------------------------------------------------------------------------------- /images/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/11.png -------------------------------------------------------------------------------- /images/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/12.png -------------------------------------------------------------------------------- /images/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/13.png -------------------------------------------------------------------------------- /images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/2.png -------------------------------------------------------------------------------- /images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/3.png -------------------------------------------------------------------------------- /images/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/4.png -------------------------------------------------------------------------------- /images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/5.png -------------------------------------------------------------------------------- /images/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/6.png -------------------------------------------------------------------------------- /images/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/7.png -------------------------------------------------------------------------------- /images/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/8.png -------------------------------------------------------------------------------- /images/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/9.png -------------------------------------------------------------------------------- /images/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/application.png -------------------------------------------------------------------------------- /images/application_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/images/application_icon.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/adb/linux/adb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/adb/linux/adb -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/adb/mac/adb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/adb/mac/adb -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/adb/windows/AdbWinApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/adb/windows/AdbWinApi.dll -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/adb/windows/AdbWinUsbApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/adb/windows/AdbWinUsbApi.dll -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/adb/windows/adb.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/adb/windows/adb.exe -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/application_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/application_icon.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/application_icon_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/application_icon_2.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/asdasd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/asdasd.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/blue.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/database.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/green.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/hash_tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/hash_tag.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/orange.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/pencil.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/assets/icons/sql_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/assets/icons/sql_table.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project AndroidDBViewer. 12 | 13 | 14 | 117 | 118 | 119 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/built-jar.properties: -------------------------------------------------------------------------------- 1 | #Wed, 02 Mar 2016 01:38:12 +0530 2 | 3 | 4 | C\:\\Users\\Thedath\ Oudarya\\Documents\\GitHub\\AndroidDBvieweR\\netbeans-project\\AndroidDBvieweR= 5 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/adb/linux/adb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/adb/linux/adb -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/adb/mac/adb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/adb/mac/adb -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/adb/windows/AdbWinApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/adb/windows/AdbWinApi.dll -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/adb/windows/AdbWinUsbApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/adb/windows/AdbWinUsbApi.dll -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/adb/windows/adb.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/adb/windows/adb.exe -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/application_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/application_icon.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/application_icon_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/application_icon_2.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/asdasd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/asdasd.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/blue.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/database.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/green.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/hash_tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/hash_tag.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/orange.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/pencil.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/build/classes/icons/sql_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/build/classes/icons/sql_table.png -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/lib/JTattoo-1.6.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/lib/JTattoo-1.6.11.jar -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/lib/org.json-20120521.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/lib/org.json-20120521.jar -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/lib/wagu.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/lib/wagu.jar -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=8ff50cb7 2 | build.xml.script.CRC32=ec80fd64 3 | build.xml.stylesheet.CRC32=8064a381@1.74.1.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=43be17e6 7 | nbproject/build-impl.xml.script.CRC32=8814a065 8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.1.48 9 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/nbproject/private/config.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/netbeans-project/AndroidDBvieweR/nbproject/private/config.properties -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | javac.debug=true 5 | javadoc.preview=true 6 | user.properties.file=C:\\Users\\Thedath Oudarya\\AppData\\Roaming\\NetBeans\\8.0\\build.properties 7 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/C:/Users/Thedath%20Oudarya/Documents/GitHub/AndroidDBvieweR/netbeans-project/AndroidDBvieweR/build.xml 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=AndroidDBvieweR 7 | application.vendor=Thedath Oudarya 8 | auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml 9 | build.classes.dir=${build.dir}/classes 10 | build.classes.excludes=**/*.java,**/*.form 11 | # This directory is removed when the project is cleaned: 12 | build.dir=build 13 | build.generated.dir=${build.dir}/generated 14 | build.generated.sources.dir=${build.dir}/generated-sources 15 | # Only compile against the classpath explicitly listed here: 16 | build.sysclasspath=ignore 17 | build.test.classes.dir=${build.dir}/test/classes 18 | build.test.results.dir=${build.dir}/test/results 19 | # Uncomment to specify the preferred debugger connection transport: 20 | #debug.transport=dt_socket 21 | debug.classpath=\ 22 | ${run.classpath} 23 | debug.test.classpath=\ 24 | ${run.test.classpath} 25 | # Files in build.classes.dir which should be excluded from distribution jar 26 | dist.archive.excludes= 27 | # This directory is removed when the project is cleaned: 28 | dist.dir=dist 29 | dist.jar=${dist.dir}/AndroidDBvieweR.jar 30 | dist.javadoc.dir=${dist.dir}/javadoc 31 | endorsed.classpath= 32 | excludes= 33 | file.reference.JTattoo-1.6.11.jar=C:\\Users\\Thedath Oudarya\\Downloads\\JTattoo-1.6.11.jar 34 | file.reference.org.json-20120521.jar-1=lib/org.json-20120521.jar 35 | file.reference.wagu.jar=lib\\wagu.jar 36 | includes=** 37 | jar.compress=true 38 | javac.classpath=\ 39 | ${file.reference.org.json-20120521.jar-1}:\ 40 | ${file.reference.wagu.jar}:\ 41 | ${libs.absolutelayout.classpath}:\ 42 | ${file.reference.JTattoo-1.6.11.jar} 43 | # Space-separated list of extra javac options 44 | javac.compilerargs= 45 | javac.deprecation=false 46 | javac.processorpath=\ 47 | ${javac.classpath} 48 | javac.source=1.6 49 | javac.target=1.6 50 | javac.test.classpath=\ 51 | ${javac.classpath}:\ 52 | ${build.classes.dir} 53 | javac.test.processorpath=\ 54 | ${javac.test.classpath} 55 | javadoc.additionalparam= 56 | javadoc.author=false 57 | javadoc.encoding=${source.encoding} 58 | javadoc.noindex=false 59 | javadoc.nonavbar=false 60 | javadoc.notree=false 61 | javadoc.private=false 62 | javadoc.splitindex=true 63 | javadoc.use=true 64 | javadoc.version=false 65 | javadoc.windowtitle= 66 | main.class=com.clough.android.adbv.Launcher 67 | manifest.file=manifest.mf 68 | meta.inf.dir=${src.dir}/META-INF 69 | mkdist.disabled=false 70 | platform.active=default_platform 71 | project.license=gpl30 72 | run.classpath=\ 73 | ${javac.classpath}:\ 74 | ${build.classes.dir} 75 | # Space-separated list of JVM arguments used when running the project. 76 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 77 | # To set system properties for unit tests define test-sys-prop.name=value: 78 | run.jvmargs= 79 | run.test.classpath=\ 80 | ${javac.test.classpath}:\ 81 | ${build.test.classes.dir} 82 | source.encoding=UTF-8 83 | src.assets.dir=assets 84 | src.dir=src 85 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | AndroidDBvieweR 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/Launcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv; 18 | 19 | import com.clough.android.adbv.exception.ADBManagerException; 20 | import com.clough.android.adbv.exception.HistoryManagerException; 21 | import com.clough.android.adbv.manager.ADBManager; 22 | import com.clough.android.adbv.manager.HistoryManager; 23 | import com.clough.android.adbv.manager.IOManager; 24 | import com.clough.android.adbv.view.MainFrame; 25 | import com.clough.android.adbv.view.WaitingForDeviceDialog; 26 | import com.jtattoo.plaf.aluminium.AluminiumLookAndFeel; 27 | import java.io.IOException; 28 | import javax.swing.JOptionPane; 29 | import javax.swing.UIManager; 30 | import javax.swing.UnsupportedLookAndFeelException; 31 | import javax.swing.plaf.metal.MetalLookAndFeel; 32 | 33 | // Class responsible for the launch of the AndroidDBViewer desktop application 34 | public class Launcher { 35 | 36 | public static void main(String[] args) { 37 | 38 | // Applying look and feel 39 | try { 40 | UIManager.setLookAndFeel(new AluminiumLookAndFeel()); 41 | } catch (UnsupportedLookAndFeelException ex1) { 42 | try { 43 | UIManager.setLookAndFeel(new MetalLookAndFeel()); 44 | } catch (UnsupportedLookAndFeelException ex) { 45 | } 46 | } 47 | 48 | // Displaying a dialog until connect with a android application 49 | WaitingForDeviceDialog waitingForDeviceDialog = new WaitingForDeviceDialog(); 50 | waitingForDeviceDialog.setVisible(true); 51 | 52 | String errorMessage = ""; 53 | try { 54 | 55 | // Preparing for the oparations based on android debugger bridge(adb) 56 | ADBManager adbManager = new ADBManager(); 57 | 58 | // Starts configuring the desktop application HistoryManager 59 | HistoryManager historyManager = new HistoryManager(adbManager.getApplicationFile()); 60 | 61 | // Connecting with the android device and one of it's installed application 62 | // which use ADBVApplication as it's 'application' 63 | IOManager ioManager = adbManager.makeConnection(); 64 | waitingForDeviceDialog.dispose(); 65 | 66 | // Launching main view of the application 67 | new MainFrame(ioManager, historyManager).setVisible(true); 68 | } catch (ADBManagerException ex) { 69 | errorMessage = ex.getLocalizedMessage(); 70 | } catch (IOException ex) { 71 | errorMessage = ex.getLocalizedMessage(); 72 | } catch (HistoryManagerException ex) { 73 | errorMessage = ex.getLocalizedMessage(); 74 | } finally { 75 | if (!errorMessage.isEmpty()) { 76 | JOptionPane.showMessageDialog(null, errorMessage, "Application error", JOptionPane.ERROR_MESSAGE); 77 | System.exit(0); 78 | } 79 | } 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/controller/RowController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.controller; 18 | 19 | import com.clough.android.adbv.model.Row; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** 24 | * 25 | * @author thedathoudarya 26 | */ 27 | public class RowController { 28 | 29 | private static final RowController ROW_CONTROLLER = new RowController(); 30 | 31 | private List rowList; 32 | 33 | private int initialRowCount; 34 | 35 | private RowController() { 36 | } 37 | 38 | public static RowController getPreparedRowController(List rowList) { 39 | ROW_CONTROLLER.rowList = rowList; 40 | ROW_CONTROLLER.initialRowCount = rowList.size(); 41 | return ROW_CONTROLLER; 42 | } 43 | 44 | private void changeRowStatus(int rowIndex, int status) { 45 | Row row = rowList.get(rowIndex); 46 | if (row != null) { 47 | row.setRowStatus(status); 48 | } 49 | } 50 | 51 | public void insertRow(Object[] newRow) { 52 | rowList.add(new Row(rowList.size(), newRow, Row.INSERTED)); 53 | } 54 | 55 | private int tableRowIndexToListIndex(int rowIndex) { 56 | return tableRowIndexToListIndex(0, rowIndex); 57 | } 58 | 59 | private int tableRowIndexToListIndex(int start, int rowIndex) { 60 | int skipCount = 0; 61 | for (int i = start; i <= rowIndex; i++) { 62 | Row row = rowList.get(i); 63 | if (row.getRowStatus() == Row.REMOVED) { 64 | skipCount++; 65 | } 66 | } 67 | if (skipCount == 0) { 68 | return rowIndex; 69 | } else { 70 | return tableRowIndexToListIndex(rowIndex + 1, rowIndex + skipCount); 71 | } 72 | } 73 | 74 | public void removeRow(int rowIndex) { 75 | changeRowStatus(tableRowIndexToListIndex(rowIndex), Row.REMOVED); 76 | } 77 | 78 | public void updateRow(int rowIndex, Object[] updatedRow) { 79 | int listRowIndex = tableRowIndexToListIndex(rowIndex); 80 | rowList.set(listRowIndex, new Row(listRowIndex, updatedRow, Row.UPDATED)); 81 | } 82 | 83 | public List getAllRows() { 84 | return rowList; 85 | } 86 | 87 | public List getRowsToInsert() { 88 | List insertedRowList = new ArrayList(); 89 | for (int i = initialRowCount; i < rowList.size(); i++) { 90 | Row row = rowList.get(i); 91 | if (row.getRowStatus() == Row.INSERTED || row.getRowStatus() == Row.UPDATED) { 92 | insertedRowList.add(row); 93 | } 94 | } 95 | return insertedRowList; 96 | } 97 | 98 | public List getRowsToUpdate() { 99 | List updateRowList = new ArrayList(); 100 | for (int i = 0; i < initialRowCount; i++) { 101 | Row row = rowList.get(i); 102 | if (row.getRowStatus() == Row.UPDATED) { 103 | updateRowList.add(row); 104 | } 105 | } 106 | return updateRowList; 107 | } 108 | 109 | public List getRowsToDelete() { 110 | List removedRowList = new ArrayList(); 111 | for (int i = 0; i < initialRowCount; i++) { 112 | Row row = rowList.get(i); 113 | if (row.getRowStatus() == Row.REMOVED) { 114 | removedRowList.add(row); 115 | } 116 | } 117 | return removedRowList; 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/exception/ADBManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.exception; 18 | 19 | /** 20 | * 21 | * @author Thedath Oudarya 22 | */ 23 | public class ADBManagerException extends Exception { 24 | 25 | public ADBManagerException(String message){ 26 | super(message); 27 | } 28 | 29 | public ADBManagerException(Exception ex){ 30 | super(ex); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/exception/HistoryManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.exception; 18 | 19 | /** 20 | * 21 | * @author thedathoudarya 22 | */ 23 | public class HistoryManagerException extends Exception{ 24 | 25 | public HistoryManagerException(String message){ 26 | super(message); 27 | } 28 | 29 | public HistoryManagerException(Exception ex){ 30 | super(ex); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/exception/IOManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.exception; 18 | 19 | /** 20 | * 21 | * @author thedathoudarya 22 | */ 23 | public class IOManagerException extends Exception { 24 | 25 | public IOManagerException(String message){ 26 | super(message); 27 | } 28 | 29 | public IOManagerException(Exception ex){ 30 | super(ex); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/manager/ADBManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.manager; 18 | 19 | import com.clough.android.adbv.Launcher; 20 | import com.clough.android.adbv.exception.ADBManagerException; 21 | import com.clough.android.adbv.model.Data; 22 | import java.io.BufferedReader; 23 | import java.io.File; 24 | import java.io.FileOutputStream; 25 | import java.io.IOException; 26 | import java.io.InputStream; 27 | import java.io.InputStreamReader; 28 | import java.io.PrintWriter; 29 | import java.net.Socket; 30 | import javax.swing.JOptionPane; 31 | import org.json.JSONException; 32 | import org.json.JSONObject; 33 | 34 | /** 35 | * 36 | * Manage operations based on android debugger bridge(adb) 37 | */ 38 | public final class ADBManager { 39 | 40 | // Port number that desktop application sockets use 41 | public static final int PC_PORT = 1992; 42 | 43 | // Port number that server socket in android application uses 44 | public static final int APP_PORT = 1993; 45 | 46 | // Operation system 47 | private final String OS; 48 | 49 | // Adb, executable file path 50 | private String adbPath; 51 | 52 | // Application's main file path 53 | private final File APPLICATION_FILE; 54 | 55 | // System home path 56 | private final String SYSTEM_HOME_PATH; 57 | 58 | public ADBManager() throws ADBManagerException { 59 | 60 | // Getting the operation system name 61 | OS = System.getProperty("os.name").toLowerCase(); 62 | 63 | // Getting the path of the home directory of this system 64 | SYSTEM_HOME_PATH = System.getProperty("user.home"); 65 | 66 | if (!new File(SYSTEM_HOME_PATH).canWrite()) { 67 | 68 | // This application uses system default home directory to store the 69 | // adb executable file and application_db file. 70 | // If the system home diretory isn't writable, application cannot proceed further 71 | throw new ADBManagerException("User home directory is not writable"); 72 | } 73 | 74 | // Creating a new directory named 'adbv' for application's purposes 75 | APPLICATION_FILE = new File(SYSTEM_HOME_PATH, "/.android/adbv/"); 76 | if (!APPLICATION_FILE.exists() && !APPLICATION_FILE.mkdirs()) { 77 | 78 | // If cannot create the directory, application cannot proceed furhter 79 | throw new ADBManagerException("Application direcory not created"); 80 | } 81 | 82 | // Make the 'adbv' directory writable, if currently it's not 83 | if (!APPLICATION_FILE.canWrite()) { 84 | APPLICATION_FILE.setWritable(true); 85 | } 86 | } 87 | 88 | /** 89 | * Selecting the relevant executable adb file/s for copying into the application's directory 90 | * @throws ADBManagerException 91 | * @throws IOException 92 | */ 93 | private void placeRelevantAdb() throws ADBManagerException, IOException { 94 | if (OS.contains("windows")) { 95 | String windowsPath = "/adb/windows/"; 96 | adbPath = copyAssets(windowsPath, "adb.exe"); 97 | copyAssets(windowsPath, "AdbWinApi.dll"); 98 | copyAssets(windowsPath, "AdbWinUsbApi.dll"); 99 | } else if (OS.contains("linux")) { 100 | String linuxPath = "/adb/linux/"; 101 | adbPath = copyAssets(linuxPath, "adb"); 102 | } else if (OS.contains("mac")) { 103 | String macPath = "/adb/mac/"; 104 | adbPath = copyAssets(macPath, "adb"); 105 | } else { 106 | // Only windows, ubuntu and mac OSes can run AndroidDBviewer 107 | throw new ADBManagerException("Unsupproted operation system."); 108 | } 109 | } 110 | 111 | /** 112 | * Copying the file by the given file name from the source directory 113 | * to application's directory 114 | * @param sourceFilePath Source file path depending on the OS 115 | * @param fileName Name of the file in the sourceFilePath to be copied 116 | * @return Absolute file path to the copied file 117 | * @throws IOException 118 | * @throws ADBManagerException 119 | */ 120 | private String copyAssets(String sourceFilePath, String fileName) throws IOException, ADBManagerException { 121 | File out = new File(APPLICATION_FILE, fileName); 122 | if (!out.exists()) { 123 | InputStream fis = Launcher.class.getResourceAsStream(sourceFilePath + fileName); 124 | if (fis != null) { 125 | FileOutputStream fos = new FileOutputStream(out); 126 | int read; 127 | while ((read = fis.read()) != -1) { 128 | fos.write(read); 129 | } 130 | fos.flush(); 131 | fis.close(); 132 | fos.close(); 133 | } 134 | } 135 | if (!out.setExecutable(true)) { 136 | throw new ADBManagerException("Copied ADB file couldn't make executable"); 137 | } 138 | return out.getAbsolutePath(); 139 | 140 | } 141 | 142 | /** 143 | * Executing the adb commands given in var-args 144 | * @param args adb command in var-args 145 | */ 146 | private synchronized void adb(final String... args) { 147 | String[] commands = new String[args.length + 1]; 148 | commands[0] = adbPath; 149 | System.arraycopy(args, 0, commands, 1, args.length); 150 | try { 151 | Runtime.getRuntime().exec(commands).waitFor(); 152 | } catch (IOException ex) { 153 | JOptionPane.showMessageDialog(null, ex.getLocalizedMessage(), "Android DB Viewer", JOptionPane.ERROR_MESSAGE); 154 | } catch (InterruptedException ex) { 155 | JOptionPane.showMessageDialog(null, ex.getLocalizedMessage(), "Android DB Viewer", JOptionPane.ERROR_MESSAGE); 156 | } 157 | } 158 | 159 | /** 160 | * Starting android debugger bridge 161 | */ 162 | private void startADB() { 163 | adb("start-server"); 164 | } 165 | 166 | /** 167 | * Ending the android debugger bridge 168 | */ 169 | private void killServer() { 170 | adb("kill-server"); 171 | } 172 | 173 | /** 174 | * Forwarding the PC_PORT which sockets of desktop application uses, to the APP_PORT 175 | * which server socket of android application uses. 176 | */ 177 | private void portForwarding() { 178 | adb("forward", "tcp:" + PC_PORT, "tcp:" + APP_PORT); 179 | } 180 | 181 | /** 182 | * Executing relevant adb commands in the right order to make the connection 183 | * with the device and then with the ADBVApplication configured app. 184 | */ 185 | private void prepareADB() { 186 | try { 187 | startADB(); 188 | portForwarding(); 189 | Thread.sleep(1500); 190 | } catch (InterruptedException ex1) { 191 | } 192 | } 193 | 194 | /** 195 | * Waiting for a device to connect and connect with it's one of eligible 196 | * android application for AndroidDBViewer to run. 197 | * @return IOManager instance configured for a android application 198 | * @throws IOException 199 | * @throws ADBManagerException 200 | */ 201 | public IOManager makeConnection() throws IOException, ADBManagerException { 202 | 203 | // Placing adb executable files for the desktop application use 204 | placeRelevantAdb(); 205 | 206 | // Trying to connect with android application again and agian 207 | // when ever an attempt is fail 208 | while (true) { 209 | try { 210 | 211 | // Creating a socket with PC_PORT and trying to connect with an server socket. 212 | // Connecting can fails due the ports not being forwarded or due to the 213 | // server socket not being started yet. 214 | // To be able to detect the server socket as running, a device must connected to the PC 215 | // and ADBVApplication configured android app must run on the device. 216 | final Socket deviceSocket = new Socket("localhost", PC_PORT); 217 | 218 | // Requesting to connect 219 | new PrintWriter(deviceSocket.getOutputStream(), true).println(new Data(Data.CONNECTION_REQUEST, "", "").toJSON().toString()); 220 | Data recivedData = new Data(new JSONObject(new BufferedReader(new InputStreamReader(deviceSocket.getInputStream())).readLine())); 221 | if (recivedData.getStatus() == Data.CONNECTION_ACCEPTED) { 222 | 223 | // Adding a shudown hook to disconnect the adb connection and close the socket connection 224 | Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { 225 | 226 | @Override 227 | public void run() { 228 | killServer(); 229 | try { 230 | deviceSocket.shutdownInput(); 231 | deviceSocket.shutdownOutput(); 232 | deviceSocket.close(); 233 | } catch (IOException ex) { 234 | } 235 | } 236 | })); 237 | 238 | // Returning an IOManager created for this connection 239 | return new IOManager(deviceSocket); 240 | } 241 | } catch (IOException ex) { 242 | prepareADB(); 243 | } catch (NullPointerException ex) { 244 | prepareADB(); 245 | } catch (JSONException ex) { 246 | prepareADB(); 247 | } 248 | } 249 | } 250 | 251 | public File getApplicationFile() { 252 | return APPLICATION_FILE; 253 | } 254 | 255 | } 256 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/manager/HistoryManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.manager; 18 | 19 | import com.clough.android.adbv.exception.HistoryManagerException; 20 | import java.io.File; 21 | import java.io.FileInputStream; 22 | import java.io.FileNotFoundException; 23 | import java.io.FileOutputStream; 24 | import java.io.IOException; 25 | import java.io.ObjectInputStream; 26 | import java.io.ObjectOutputStream; 27 | import java.util.ArrayList; 28 | 29 | /** 30 | * 31 | * @author thedathoudarya 32 | */ 33 | public class HistoryManager { 34 | 35 | private final File applicationDBFile; 36 | 37 | // private Map> historyMap; 38 | 39 | private ArrayList historyList; 40 | 41 | public HistoryManager(File applicationFile) throws HistoryManagerException { 42 | this.applicationDBFile = new File(applicationFile, "/application_db"); 43 | if (!applicationDBFile.exists()) { 44 | saveApplicationDb(new ArrayList()); 45 | } 46 | this.historyList = readApplicationDb(); 47 | } 48 | 49 | private void saveApplicationDb(ArrayList historyList) throws HistoryManagerException { 50 | FileOutputStream fos = null; 51 | ObjectOutputStream oos = null; 52 | try { 53 | fos = new FileOutputStream(applicationDBFile); 54 | oos = new ObjectOutputStream(fos); 55 | oos.writeObject(historyList); 56 | oos.flush(); 57 | } catch (FileNotFoundException ex) { 58 | throw new HistoryManagerException(ex); 59 | } catch (IOException ex) { 60 | throw new HistoryManagerException(ex); 61 | } finally { 62 | try { 63 | if (oos != null) { 64 | oos.close(); 65 | } 66 | if (fos != null) { 67 | fos.close(); 68 | } 69 | } catch (IOException ex) { 70 | throw new HistoryManagerException(ex); 71 | } 72 | } 73 | } 74 | 75 | private ArrayList readApplicationDb() throws HistoryManagerException { 76 | FileInputStream fis = null; 77 | ObjectInputStream ois = null; 78 | try { 79 | fis = new FileInputStream(applicationDBFile); 80 | ois = new ObjectInputStream(fis); 81 | return (ArrayList) ois.readObject(); 82 | } catch (FileNotFoundException ex) { 83 | throw new HistoryManagerException(ex); 84 | } catch (IOException ex) { 85 | throw new HistoryManagerException(ex); 86 | } catch (ClassNotFoundException ex) { 87 | throw new HistoryManagerException(ex); 88 | } finally { 89 | try { 90 | if (ois != null) { 91 | ois.close(); 92 | } 93 | if (fis != null) { 94 | fis.close(); 95 | } 96 | } catch (IOException ex) { 97 | throw new HistoryManagerException(ex); 98 | } 99 | } 100 | } 101 | 102 | public ArrayList getHistoryList() { 103 | return historyList; 104 | } 105 | 106 | public void addApplicationHistory(String appId, String query) { 107 | historyList.add(new String[]{appId, query}); 108 | } 109 | 110 | public void saveApplicationDb() throws HistoryManagerException { 111 | saveApplicationDb(historyList); 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/manager/IOManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.manager; 18 | 19 | import com.clough.android.adbv.exception.IOManagerException; 20 | import com.clough.android.adbv.model.Data; 21 | import java.io.BufferedReader; 22 | import java.io.IOException; 23 | import java.io.InputStreamReader; 24 | import java.io.PrintWriter; 25 | import java.net.Socket; 26 | import org.json.JSONException; 27 | import org.json.JSONObject; 28 | 29 | /** 30 | * 31 | * @author thedathoudarya 32 | */ 33 | public class IOManager { 34 | 35 | private final Thread listenerThread; 36 | 37 | private final Socket adbSocket; 38 | 39 | private boolean stayAlive; 40 | 41 | private final PrintWriter pw; 42 | 43 | private final BufferedReader br; 44 | 45 | private final Data defaultData; 46 | 47 | private Data requestingData; 48 | 49 | private Data respondingData; 50 | 51 | private ConnectionLostListener connectionLostListener; 52 | 53 | public IOManager(Socket socket) throws IOException { 54 | this.adbSocket = socket; 55 | this.stayAlive = true; 56 | this.pw = new PrintWriter(adbSocket.getOutputStream(), true); 57 | this.br = new BufferedReader(new InputStreamReader(adbSocket.getInputStream())); 58 | this.defaultData = new Data(Data.LIVE_CONNECTION, "", ""); 59 | this.requestingData = defaultData; 60 | 61 | listenerThread = new Thread(new Runnable() { 62 | @Override 63 | public void run() { 64 | while (stayAlive) { 65 | try { 66 | pw.println(requestingData.toJSON().toString()); 67 | String receivedDataString = br.readLine(); 68 | respondingData = new Data(new JSONObject(receivedDataString)); 69 | Thread.sleep(10); 70 | } catch (InterruptedException ex) { 71 | stayAlive = false; 72 | break; 73 | } catch (IOException ex) { 74 | stayAlive = false; 75 | break; 76 | } catch (JSONException ex) { 77 | stayAlive = false; 78 | break; 79 | } catch (NullPointerException ex) { 80 | stayAlive = false; 81 | break; 82 | } finally { 83 | if (!stayAlive && connectionLostListener != null) { 84 | connectionLostListener.onDisconnect(); 85 | } 86 | } 87 | } 88 | try { 89 | pw.close(); 90 | br.close(); 91 | adbSocket.close(); 92 | } catch (IOException ex) { 93 | } 94 | } 95 | }); 96 | listenerThread.start(); 97 | } 98 | 99 | public void exit() { 100 | stayAlive = false; 101 | } 102 | 103 | private String waitForResult(Data requestingData) throws IOManagerException { 104 | this.requestingData = requestingData; 105 | String result = ""; 106 | if (stayAlive) { 107 | while (respondingData == null || respondingData.getStatus() != requestingData.getStatus() || (requestingData.getStatus() == Data.QUERY && !requestingData.getQuery().equals(respondingData.getQuery()))) { 108 | this.requestingData = requestingData; 109 | try { 110 | Thread.sleep(10); 111 | } catch (InterruptedException ex) { 112 | throw new IOManagerException(ex.getLocalizedMessage()); 113 | } 114 | } 115 | result = respondingData.getResult(); 116 | this.requestingData = defaultData; 117 | return result; 118 | } else { 119 | throw new IOManagerException("Connection being disconnected"); 120 | } 121 | } 122 | 123 | public String executeQuery(String query) throws IOManagerException { 124 | return waitForResult(new Data(Data.QUERY, query, "")); 125 | } 126 | 127 | public String getDeviceName() throws IOManagerException { 128 | return waitForResult(new Data(Data.DEVICE_NAME, "", "")); 129 | } 130 | 131 | public String getApplicationID() throws IOManagerException { 132 | return waitForResult(new Data(Data.APPLICATION_ID, "", "")); 133 | } 134 | 135 | public String getDatabaseName() throws IOManagerException { 136 | return waitForResult(new Data(Data.DATABASE_NAME, "", "")); 137 | } 138 | 139 | public void addConnectionLostListener(ConnectionLostListener connectionLostListener) { 140 | this.connectionLostListener = connectionLostListener; 141 | } 142 | 143 | public String getTableNames() throws IOManagerException { 144 | return executeQuery("select `name`, `sql` from sqlite_master where type = 'table' order by `name`"); 145 | } 146 | 147 | public String getTableColumnInfo(String tableName) throws IOManagerException { 148 | return executeQuery("pragma table_info('" + tableName + "')"); 149 | } 150 | 151 | public interface ConnectionLostListener { 152 | public void onDisconnect(); 153 | } 154 | 155 | } 156 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/model/Data.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.model; 18 | 19 | import java.io.Serializable; 20 | import org.json.JSONException; 21 | import org.json.JSONObject; 22 | 23 | /** 24 | * 25 | * @author thedathoudarya 26 | */ 27 | public class Data implements Serializable { 28 | 29 | public static final int LIVE_CONNECTION = 0; 30 | 31 | public static final int QUERY = 1; 32 | 33 | public static final int CONNECTION_REQUEST = 2; 34 | 35 | public static final int CONNECTION_ACCEPTED = 3; 36 | 37 | public static final int DEVICE_NAME = 4; 38 | 39 | public static final int APPLICATION_ID = 5; 40 | 41 | public static final int DATABASE_NAME = 6; 42 | 43 | private int status; 44 | 45 | private String query; 46 | 47 | private String result; 48 | 49 | public Data() { 50 | } 51 | 52 | public Data(JSONObject dataJSONObject) throws JSONException { 53 | parseData(dataJSONObject); 54 | } 55 | 56 | public Data(int status, String request, String response) { 57 | this.status = status; 58 | this.query = request; 59 | this.result = response; 60 | } 61 | 62 | public int getStatus() { 63 | return status; 64 | } 65 | 66 | public Data setStatus(int status) { 67 | this.status = status; 68 | return this; 69 | } 70 | 71 | public String getQuery() { 72 | return query; 73 | } 74 | 75 | public Data setQuery(String query) { 76 | this.query = query; 77 | return this; 78 | } 79 | 80 | public String getResult() { 81 | return result; 82 | } 83 | 84 | public Data setResult(String result) { 85 | this.result = result; 86 | return this; 87 | } 88 | 89 | public JSONObject toJSON() { 90 | try { 91 | return new JSONObject() 92 | .put("status", status) 93 | .put("query", query) 94 | .put("result", result); 95 | } catch (JSONException ex) { 96 | return null; 97 | } 98 | } 99 | 100 | public Data parseData(JSONObject dataJSON) throws JSONException { 101 | this 102 | .setStatus(dataJSON.getInt("status")) 103 | .setQuery(dataJSON.getString("query")) 104 | .setResult(dataJSON.getString("result")); 105 | 106 | return this; 107 | } 108 | 109 | @Override 110 | public int hashCode() { 111 | int hash = 7; 112 | hash = 53 * hash + this.status; 113 | hash = 53 * hash + (this.query != null ? this.query.hashCode() : 0); 114 | hash = 53 * hash + (this.result != null ? this.result.hashCode() : 0); 115 | return hash; 116 | 117 | } 118 | 119 | @Override 120 | public boolean equals(Object obj) { 121 | if (obj == null) { 122 | return false; 123 | } 124 | if (getClass() != obj.getClass()) { 125 | return false; 126 | } 127 | final Data other = (Data) obj; 128 | if (this.status != other.status) { 129 | return false; 130 | } 131 | if ((this.query == null) ? (other.query != null) : !this.query.equals(other.query)) { 132 | return false; 133 | } 134 | if ((this.result == null) ? (other.result != null) : !this.result.equals(other.result)) { 135 | return false; 136 | } 137 | return true; 138 | } 139 | 140 | } 141 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/model/Field.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.model; 18 | 19 | /** 20 | * 21 | * @author ThedathOudarya 22 | */ 23 | public class Field { 24 | private int fieldIndex; 25 | private String fieldName; 26 | private String fieldType; 27 | private boolean fieldPrimarKey; 28 | private boolean fieldNotNull; 29 | private boolean fieldAutoIncrement; 30 | private boolean fieldUnique; 31 | private String fieldDefault; 32 | 33 | public Field() { 34 | } 35 | 36 | public Field(int fieldIndex, String fieldName, String fieldType, boolean fieldPrimarKey, boolean fieldNotNull, boolean fieldAutoIncrement, boolean fieldUnique, String fieldDefault) { 37 | this.fieldIndex = fieldIndex; 38 | this.fieldName = fieldName; 39 | this.fieldType = fieldType; 40 | this.fieldPrimarKey = fieldPrimarKey; 41 | this.fieldNotNull = fieldNotNull; 42 | this.fieldAutoIncrement = fieldAutoIncrement; 43 | this.fieldUnique = fieldUnique; 44 | this.fieldDefault = fieldDefault; 45 | } 46 | 47 | public String getFieldDefault() { 48 | return fieldDefault; 49 | } 50 | 51 | public void setFieldDefault(String fieldDefault) { 52 | this.fieldDefault = fieldDefault; 53 | } 54 | 55 | public int getFieldIndex() { 56 | return fieldIndex; 57 | } 58 | 59 | public void setFieldIndex(int fieldIndex) { 60 | this.fieldIndex = fieldIndex; 61 | } 62 | 63 | public String getFieldName() { 64 | return fieldName; 65 | } 66 | 67 | public void setFieldName(String fieldName) { 68 | this.fieldName = fieldName; 69 | } 70 | 71 | public String getFieldType() { 72 | return fieldType; 73 | } 74 | 75 | public void setFieldType(String fieldType) { 76 | this.fieldType = fieldType; 77 | } 78 | 79 | public boolean isFieldPrimarKey() { 80 | return fieldPrimarKey; 81 | } 82 | 83 | public void setFieldPrimarKey(boolean fieldPrimarKey) { 84 | this.fieldPrimarKey = fieldPrimarKey; 85 | } 86 | 87 | public boolean isFieldNotNull() { 88 | return fieldNotNull; 89 | } 90 | 91 | public void setFieldNotNull(boolean fieldNotNull) { 92 | this.fieldNotNull = fieldNotNull; 93 | } 94 | 95 | public boolean isFieldAutoIncrement() { 96 | return fieldAutoIncrement; 97 | } 98 | 99 | public void setFieldAutoIncrement(boolean fieldAutoIncrement) { 100 | this.fieldAutoIncrement = fieldAutoIncrement; 101 | } 102 | 103 | public boolean isFieldUnique() { 104 | return fieldUnique; 105 | } 106 | 107 | public void setFieldUnique(boolean fieldUnique) { 108 | this.fieldUnique = fieldUnique; 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/model/Row.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.model; 18 | 19 | /** 20 | * 21 | * @author thedathoudarya 22 | */ 23 | public class Row { 24 | 25 | public static final int DEFAULT = 0; 26 | public static final int UPDATED = 1; 27 | public static final int INSERTED = 2; 28 | public static final int REMOVED = 3; 29 | 30 | private int rowIndex = 0; 31 | 32 | private Object[] rowData; 33 | 34 | private int rowStatus; 35 | 36 | public Row() { 37 | } 38 | 39 | public Row(int rowIndex, Object[] rowData, int rowStatus) { 40 | this.rowIndex = rowIndex; 41 | this.rowData = rowData; 42 | this.rowStatus = rowStatus; 43 | } 44 | 45 | public int getRowIndex() { 46 | return rowIndex; 47 | } 48 | 49 | public void setRowIndex(int rowIndex) { 50 | this.rowIndex = rowIndex; 51 | } 52 | 53 | public Object[] getRowData() { 54 | return rowData; 55 | } 56 | 57 | public void setRowData(Object[] rowData) { 58 | this.rowData = rowData; 59 | } 60 | 61 | public int getRowStatus() { 62 | return rowStatus; 63 | } 64 | 65 | public void setRowStatus(int rowStatus) { 66 | this.rowStatus = rowStatus; 67 | } 68 | 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/util/TableColumnAdjuster.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.util; 18 | 19 | /** 20 | * 21 | * @author thedathoudarya 22 | */ 23 | import java.awt.*; 24 | import java.awt.event.*; 25 | import java.beans.*; 26 | import java.util.*; 27 | import javax.swing.*; 28 | import javax.swing.event.*; 29 | import javax.swing.table.*; 30 | 31 | public class TableColumnAdjuster implements PropertyChangeListener, TableModelListener { 32 | 33 | private JTable table; 34 | private int spacing; 35 | private boolean isColumnHeaderIncluded; 36 | private boolean isColumnDataIncluded; 37 | private boolean isOnlyAdjustLarger; 38 | private boolean isDynamicAdjustment; 39 | private Map columnSizes = new HashMap(); 40 | 41 | /* 42 | * Specify the table and use default spacing 43 | */ 44 | public TableColumnAdjuster(JTable table) { 45 | this(table, 6); 46 | } 47 | 48 | /* 49 | * Specify the table and spacing 50 | */ 51 | public TableColumnAdjuster(JTable table, int spacing) { 52 | this.table = table; 53 | this.spacing = spacing; 54 | setColumnHeaderIncluded(true); 55 | setColumnDataIncluded(true); 56 | setOnlyAdjustLarger(false); 57 | setDynamicAdjustment(false); 58 | installActions(); 59 | } 60 | 61 | /* 62 | * Adjust the widths of all the columns in the table 63 | */ 64 | public void adjustColumns() { 65 | TableColumnModel tcm = table.getColumnModel(); 66 | 67 | for (int i = 0; i < tcm.getColumnCount(); i++) { 68 | adjustColumn(i); 69 | } 70 | } 71 | 72 | /* 73 | * Adjust the width of the specified column in the table 74 | */ 75 | public void adjustColumn(final int column) { 76 | TableColumn tableColumn = table.getColumnModel().getColumn(column); 77 | 78 | if (!tableColumn.getResizable()) { 79 | return; 80 | } 81 | 82 | int columnHeaderWidth = getColumnHeaderWidth(column); 83 | int columnDataWidth = getColumnDataWidth(column); 84 | int preferredWidth = Math.max(columnHeaderWidth, columnDataWidth); 85 | 86 | updateTableColumn(column, preferredWidth); 87 | } 88 | 89 | /* 90 | * Calculated the width based on the column name 91 | */ 92 | private int getColumnHeaderWidth(int column) { 93 | if (!isColumnHeaderIncluded) { 94 | return 0; 95 | } 96 | 97 | TableColumn tableColumn = table.getColumnModel().getColumn(column); 98 | Object value = tableColumn.getHeaderValue(); 99 | TableCellRenderer renderer = tableColumn.getHeaderRenderer(); 100 | 101 | if (renderer == null) { 102 | renderer = table.getTableHeader().getDefaultRenderer(); 103 | } 104 | 105 | Component c = renderer.getTableCellRendererComponent(table, value, false, false, -1, column); 106 | return c.getPreferredSize().width; 107 | } 108 | 109 | /* 110 | * Calculate the width based on the widest cell renderer for the 111 | * given column. 112 | */ 113 | private int getColumnDataWidth(int column) { 114 | if (!isColumnDataIncluded) { 115 | return 0; 116 | } 117 | 118 | int preferredWidth = 0; 119 | int maxWidth = table.getColumnModel().getColumn(column).getMaxWidth(); 120 | 121 | for (int row = 0; row < table.getRowCount(); row++) { 122 | preferredWidth = Math.max(preferredWidth, getCellDataWidth(row, column)); 123 | 124 | // We've exceeded the maximum width, no need to check other rows 125 | if (preferredWidth >= maxWidth) { 126 | break; 127 | } 128 | } 129 | 130 | return preferredWidth; 131 | } 132 | 133 | /* 134 | * Get the preferred width for the specified cell 135 | */ 136 | private int getCellDataWidth(int row, int column) { 137 | // Inovke the renderer for the cell to calculate the preferred width 138 | 139 | TableCellRenderer cellRenderer = table.getCellRenderer(row, column); 140 | Component c = table.prepareRenderer(cellRenderer, row, column); 141 | int width = c.getPreferredSize().width + table.getIntercellSpacing().width; 142 | 143 | return width; 144 | } 145 | 146 | /* 147 | * Update the TableColumn with the newly calculated width 148 | */ 149 | private void updateTableColumn(int column, int width) { 150 | final TableColumn tableColumn = table.getColumnModel().getColumn(column); 151 | 152 | if (!tableColumn.getResizable()) { 153 | return; 154 | } 155 | 156 | width += spacing; 157 | 158 | // Don't shrink the column width 159 | if (isOnlyAdjustLarger) { 160 | width = Math.max(width, tableColumn.getPreferredWidth()); 161 | } 162 | 163 | columnSizes.put(tableColumn, new Integer(tableColumn.getWidth())); 164 | 165 | table.getTableHeader().setResizingColumn(tableColumn); 166 | tableColumn.setWidth(width); 167 | } 168 | 169 | /* 170 | * Restore the widths of the columns in the table to its previous width 171 | */ 172 | public void restoreColumns() { 173 | TableColumnModel tcm = table.getColumnModel(); 174 | 175 | for (int i = 0; i < tcm.getColumnCount(); i++) { 176 | restoreColumn(i); 177 | } 178 | } 179 | 180 | /* 181 | * Restore the width of the specified column to its previous width 182 | */ 183 | private void restoreColumn(int column) { 184 | TableColumn tableColumn = table.getColumnModel().getColumn(column); 185 | Integer width = columnSizes.get(tableColumn); 186 | 187 | if (width != null) { 188 | table.getTableHeader().setResizingColumn(tableColumn); 189 | tableColumn.setWidth(width.intValue()); 190 | } 191 | } 192 | 193 | /* 194 | * Indicates whether to include the header in the width calculation 195 | */ 196 | public void setColumnHeaderIncluded(boolean isColumnHeaderIncluded) { 197 | this.isColumnHeaderIncluded = isColumnHeaderIncluded; 198 | } 199 | 200 | /* 201 | * Indicates whether to include the model data in the width calculation 202 | */ 203 | public void setColumnDataIncluded(boolean isColumnDataIncluded) { 204 | this.isColumnDataIncluded = isColumnDataIncluded; 205 | } 206 | 207 | /* 208 | * Indicates whether columns can only be increased in size 209 | */ 210 | public void setOnlyAdjustLarger(boolean isOnlyAdjustLarger) { 211 | this.isOnlyAdjustLarger = isOnlyAdjustLarger; 212 | } 213 | 214 | /* 215 | * Indicate whether changes to the model should cause the width to be 216 | * dynamically recalculated. 217 | */ 218 | public void setDynamicAdjustment(boolean isDynamicAdjustment) { 219 | // May need to add or remove the TableModelListener when changed 220 | 221 | if (this.isDynamicAdjustment != isDynamicAdjustment) { 222 | if (isDynamicAdjustment) { 223 | table.addPropertyChangeListener(this); 224 | table.getModel().addTableModelListener(this); 225 | } else { 226 | table.removePropertyChangeListener(this); 227 | table.getModel().removeTableModelListener(this); 228 | } 229 | } 230 | 231 | this.isDynamicAdjustment = isDynamicAdjustment; 232 | } 233 | // 234 | // Implement the PropertyChangeListener 235 | // 236 | 237 | public void propertyChange(PropertyChangeEvent e) { 238 | // When the TableModel changes we need to update the listeners 239 | // and column widths 240 | 241 | if ("model".equals(e.getPropertyName())) { 242 | TableModel model = (TableModel) e.getOldValue(); 243 | model.removeTableModelListener(this); 244 | 245 | model = (TableModel) e.getNewValue(); 246 | model.addTableModelListener(this); 247 | adjustColumns(); 248 | } 249 | } 250 | // 251 | // Implement the TableModelListener 252 | // 253 | 254 | public void tableChanged(final TableModelEvent e) { 255 | if (!isColumnDataIncluded) { 256 | return; 257 | } 258 | 259 | // Needed when table is sorted. 260 | SwingUtilities.invokeLater(new Runnable() { 261 | public void run() { 262 | // A cell has been updated 263 | 264 | int column = table.convertColumnIndexToView(e.getColumn()); 265 | 266 | if (e.getType() == TableModelEvent.UPDATE && column != -1) { 267 | // Only need to worry about an increase in width for this cell 268 | 269 | if (isOnlyAdjustLarger) { 270 | int row = e.getFirstRow(); 271 | TableColumn tableColumn = table.getColumnModel().getColumn(column); 272 | 273 | if (tableColumn.getResizable()) { 274 | int width = getCellDataWidth(row, column); 275 | updateTableColumn(column, width); 276 | } 277 | } // Could be an increase of decrease so check all rows 278 | else { 279 | adjustColumn(column); 280 | } 281 | } // The update affected more than one column so adjust all columns 282 | else { 283 | adjustColumns(); 284 | } 285 | } 286 | }); 287 | } 288 | 289 | /* 290 | * Install Actions to give user control of certain functionality. 291 | */ 292 | private void installActions() { 293 | installColumnAction(true, true, "adjustColumn", "control ADD"); 294 | installColumnAction(false, true, "adjustColumns", "control shift ADD"); 295 | installColumnAction(true, false, "restoreColumn", "control SUBTRACT"); 296 | installColumnAction(false, false, "restoreColumns", "control shift SUBTRACT"); 297 | 298 | installToggleAction(true, false, "toggleDynamic", "control MULTIPLY"); 299 | installToggleAction(false, true, "toggleLarger", "control DIVIDE"); 300 | } 301 | 302 | /* 303 | * Update the input and action maps with a new ColumnAction 304 | */ 305 | private void installColumnAction( 306 | boolean isSelectedColumn, boolean isAdjust, String key, String keyStroke) { 307 | Action action = new ColumnAction(isSelectedColumn, isAdjust); 308 | KeyStroke ks = KeyStroke.getKeyStroke(keyStroke); 309 | table.getInputMap().put(ks, key); 310 | table.getActionMap().put(key, action); 311 | } 312 | 313 | /* 314 | * Update the input and action maps with new ToggleAction 315 | */ 316 | private void installToggleAction( 317 | boolean isToggleDynamic, boolean isToggleLarger, String key, String keyStroke) { 318 | Action action = new ToggleAction(isToggleDynamic, isToggleLarger); 319 | KeyStroke ks = KeyStroke.getKeyStroke(keyStroke); 320 | table.getInputMap().put(ks, key); 321 | table.getActionMap().put(key, action); 322 | } 323 | 324 | /* 325 | * Action to adjust or restore the width of a single column or all columns 326 | */ 327 | class ColumnAction extends AbstractAction { 328 | 329 | private boolean isSelectedColumn; 330 | private boolean isAdjust; 331 | 332 | public ColumnAction(boolean isSelectedColumn, boolean isAdjust) { 333 | this.isSelectedColumn = isSelectedColumn; 334 | this.isAdjust = isAdjust; 335 | } 336 | 337 | @Override 338 | public void actionPerformed(ActionEvent e) { 339 | // Handle selected column(s) width change actions 340 | 341 | if (isSelectedColumn) { 342 | int[] columns = table.getSelectedColumns(); 343 | 344 | for (int i = 0; i < columns.length; i++) { 345 | if (isAdjust) { 346 | adjustColumn(columns[i]); 347 | } else { 348 | restoreColumn(columns[i]); 349 | } 350 | } 351 | } else { 352 | if (isAdjust) { 353 | adjustColumns(); 354 | } else { 355 | restoreColumns(); 356 | } 357 | } 358 | } 359 | } 360 | 361 | /* 362 | * Toggle properties of the TableColumnAdjuster so the user can 363 | * customize the functionality to their preferences 364 | */ 365 | class ToggleAction extends AbstractAction { 366 | 367 | private boolean isToggleDynamic; 368 | private boolean isToggleLarger; 369 | 370 | public ToggleAction(boolean isToggleDynamic, boolean isToggleLarger) { 371 | this.isToggleDynamic = isToggleDynamic; 372 | this.isToggleLarger = isToggleLarger; 373 | } 374 | 375 | @Override 376 | public void actionPerformed(ActionEvent e) { 377 | if (isToggleDynamic) { 378 | setDynamicAdjustment(!isDynamicAdjustment); 379 | return; 380 | } 381 | 382 | if (isToggleLarger) { 383 | setOnlyAdjustLarger(!isOnlyAdjustLarger); 384 | return; 385 | } 386 | } 387 | } 388 | } 389 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/util/TableEditor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.util; 18 | 19 | import java.awt.Component; 20 | import javax.swing.JTable; 21 | import javax.swing.table.DefaultTableCellRenderer; 22 | import javax.swing.table.DefaultTableColumnModel; 23 | import javax.swing.table.TableCellRenderer; 24 | import javax.swing.table.TableColumn; 25 | import javax.swing.table.TableColumnModel; 26 | 27 | /** 28 | * 29 | * @author Thedath Oudarya 30 | */ 31 | public class TableEditor { 32 | 33 | private static final TableEditor TABLE_EDITOR = new TableEditor(); 34 | 35 | private TableEditor() { 36 | } 37 | 38 | public static TableEditor getInstance() { 39 | return TABLE_EDITOR; 40 | } 41 | 42 | /* 43 | for (int column = 0; column < table.getColumnCount(); column++) 44 | { 45 | TableColumn tableColumn = table.getColumnModel().getColumn(column); 46 | int preferredWidth = tableColumn.getMinWidth(); 47 | int maxWidth = tableColumn.getMaxWidth(); 48 | 49 | for (int row = 0; row < table.getRowCount(); row++) 50 | { 51 | TableCellRenderer cellRenderer = table.getCellRenderer(row, column); 52 | Component c = table.prepareRenderer(cellRenderer, row, column); 53 | int width = c.getPreferredSize().width + table.getIntercellSpacing().width; 54 | preferredWidth = Math.max(preferredWidth, width); 55 | 56 | // We've exceeded the maximum width, no need to check other rows 57 | 58 | if (preferredWidth >= maxWidth) 59 | { 60 | preferredWidth = maxWidth; 61 | break; 62 | } 63 | } 64 | 65 | tableColumn.setPreferredWidth( preferredWidth ); 66 | } 67 | */ 68 | public void adjustTable(Component tableContainer, JTable table) { 69 | table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 70 | DefaultTableColumnModel defColumnModel = (DefaultTableColumnModel) table.getColumnModel(); 71 | int columnCount = table.getColumnCount(); 72 | int[] columnWidths = new int[columnCount]; 73 | int totalWidth = 0; 74 | for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) { 75 | TableColumn tableColumn = defColumnModel.getColumn(columnIndex); 76 | TableCellRenderer headerRenderer = tableColumn.getHeaderRenderer(); 77 | if (headerRenderer == null) { 78 | headerRenderer = table.getTableHeader().getDefaultRenderer(); 79 | } 80 | int minWidth = tableColumn.getMinWidth(); 81 | int headerWidth = headerRenderer.getTableCellRendererComponent(table, tableColumn.getHeaderValue(), false, false, -1, columnIndex).getPreferredSize().width; 82 | 83 | int finalColumnWidth = Math.max(minWidth, headerWidth); 84 | for (int rowIndex = 0; rowIndex < table.getRowCount(); rowIndex++) { 85 | int rowWidth = table.prepareRenderer(table.getCellRenderer(rowIndex, columnIndex), rowIndex, columnIndex).getPreferredSize().width; 86 | finalColumnWidth = Math.max(rowWidth, finalColumnWidth); 87 | // Object cellValue = table.getValueAt(rowIndex, columnIndex); 88 | // try { 89 | // long longValue = (Long) cellValue; 90 | // cellTextField.setHorizontalAlignment(JTextField.RIGHT); 91 | // } catch (Exception e0) { 92 | // try { 93 | // double doubleValue = (Double) cellValue; 94 | // cellTextField.setHorizontalAlignment(JTextField.RIGHT); 95 | // } catch (Exception e1) { 96 | // try { 97 | // boolean doubleValue = (Boolean) cellValue; 98 | // cellTextField.setHorizontalAlignment(JTextField.CENTER); 99 | // } catch (Exception e2) { 100 | // cellTextField.setHorizontalAlignment(JTextField.LEADING); 101 | // } 102 | // } 103 | // } 104 | } 105 | columnWidths[columnIndex] = finalColumnWidth; 106 | totalWidth += columnWidths[columnIndex]; 107 | } 108 | int containerWidth = tableContainer.getWidth(); 109 | if (totalWidth < containerWidth) { 110 | TableColumnModel columnModel = table.getColumnModel(); 111 | int rest = containerWidth - totalWidth; 112 | int additionalWidth = rest / columnCount; 113 | int extraWidth = rest % columnCount; 114 | int maxWidthColumnIndex = 0; 115 | int maxColumnWidth = 0; 116 | for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) { 117 | int columnWidth = columnWidths[columnIndex]; 118 | if (maxColumnWidth < columnWidth) { 119 | maxColumnWidth = columnWidth; 120 | maxWidthColumnIndex = columnIndex; 121 | } 122 | } 123 | for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) { 124 | columnModel.getColumn(columnIndex).setPreferredWidth(columnWidths[columnIndex] + additionalWidth + (columnIndex == maxWidthColumnIndex ? extraWidth : 0)); 125 | } 126 | } 127 | } 128 | 129 | } 130 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/util/ValueHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Thedath Oudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.clough.android.adbv.util; 18 | 19 | import com.clough.android.adbv.Launcher; 20 | import javax.swing.ImageIcon; 21 | 22 | /** 23 | * 24 | * @author Thedath Oudarya 25 | */ 26 | public class ValueHolder { 27 | 28 | public static final String APP_VERSION = "1.0.1"; 29 | 30 | public static final String WINDOW_TITLE = "AndroidDBvieweR " + APP_VERSION; 31 | 32 | public interface Icons { 33 | 34 | public static final ImageIcon APPLICATION = new ImageIcon(Launcher.class.getResource("/icons/application_icon.png")); 35 | 36 | public static final ImageIcon DATABASE = new ImageIcon(Launcher.class.getResource("/icons/database.png")); 37 | 38 | public static final ImageIcon TABLE = new ImageIcon(Launcher.class.getResource("/icons/sql_table.png")); 39 | 40 | public static final ImageIcon PENCIL = new ImageIcon(Launcher.class.getResource("/icons/pencil.png")); 41 | 42 | public static final ImageIcon HASH_TAG = new ImageIcon(Launcher.class.getResource("/icons/hash_tag.png")); 43 | 44 | public static final ImageIcon BLUE = new ImageIcon(Launcher.class.getResource("/icons/blue.png")); 45 | 46 | public static final ImageIcon GREEN = new ImageIcon(Launcher.class.getResource("/icons/green.png")); 47 | 48 | public static final ImageIcon ORANGE = new ImageIcon(Launcher.class.getResource("/icons/orange.png")); 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/AddUpdateRowDialog.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
66 |
67 | 68 | 69 | 70 | 71 | <Editor/> 72 | <Renderer/> 73 | </Column> 74 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 75 | <Title/> 76 | <Editor/> 77 | <Renderer/> 78 | </Column> 79 | </TableColumnModel> 80 | </Property> 81 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 82 | <TableHeader reorderingAllowed="false" resizingAllowed="true"/> 83 | </Property> 84 | </Properties> 85 | </Component> 86 | </SubComponents> 87 | </Container> 88 | <Component class="javax.swing.JButton" name="applyButton"> 89 | <Properties> 90 | <Property name="text" type="java.lang.String" value="Apply"/> 91 | </Properties> 92 | <Events> 93 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="applyButtonActionPerformed"/> 94 | </Events> 95 | </Component> 96 | </SubComponents> 97 | </Form> 98 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/AddUpdateRowDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 | */ 17 | package com.clough.android.adbv.view; 18 | 19 | import com.clough.android.adbv.controller.RowController; 20 | import java.awt.Frame; 21 | import javax.swing.JOptionPane; 22 | import javax.swing.table.DefaultTableModel; 23 | 24 | /** 25 | * 26 | * @author thedathoudarya 27 | */ 28 | public class AddUpdateRowDialog extends javax.swing.JDialog { 29 | 30 | private final DefaultTableModel defaultTableModel; 31 | private final DefaultTableModel mainTableModel; 32 | private final RowController rowController; 33 | private final Object[] columns; 34 | private final Object[] row; 35 | private final int rowIndex; 36 | 37 | /** 38 | * Creates new form AddUpdateRowDialog 39 | */ 40 | public AddUpdateRowDialog(DefaultTableModel mainTableModel, RowController rowController, Object[] columns, Object[] row, int rowIndex) { 41 | super(new Frame(), true); 42 | initComponents(); 43 | setLocationRelativeTo(null); 44 | defaultTableModel = (DefaultTableModel) addUpdateRowTable.getModel(); 45 | this.mainTableModel = mainTableModel; 46 | this.rowController = rowController; 47 | this.columns = columns; 48 | this.row = row; 49 | this.rowIndex = rowIndex; 50 | if (row == null) { 51 | setTitle("Add new row"); 52 | for (Object column : columns) { 53 | defaultTableModel.addRow(new Object[]{column, ""}); 54 | } 55 | } else { 56 | setTitle("Update row"); 57 | for (int i = 0; i < columns.length; i++) { 58 | defaultTableModel.addRow(new Object[]{columns[i], row[i]}); 59 | } 60 | } 61 | } 62 | 63 | /** 64 | * This method is called from within the constructor to initialize the form. 65 | * WARNING: Do NOT modify this code. The content of this method is always 66 | * regenerated by the Form Editor. 67 | */ 68 | @SuppressWarnings("unchecked") 69 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 70 | private void initComponents() { 71 | 72 | jScrollPane1 = new javax.swing.JScrollPane(); 73 | addUpdateRowTable = new javax.swing.JTable(); 74 | applyButton = new javax.swing.JButton(); 75 | 76 | setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 77 | 78 | addUpdateRowTable.setModel(new javax.swing.table.DefaultTableModel( 79 | new Object [][] { 80 | 81 | }, 82 | new String [] { 83 | "Field", "Value" 84 | } 85 | ) { 86 | boolean[] canEdit = new boolean [] { 87 | false, true 88 | }; 89 | 90 | public boolean isCellEditable(int rowIndex, int columnIndex) { 91 | return canEdit [columnIndex]; 92 | } 93 | }); 94 | addUpdateRowTable.getTableHeader().setReorderingAllowed(false); 95 | jScrollPane1.setViewportView(addUpdateRowTable); 96 | if (addUpdateRowTable.getColumnModel().getColumnCount() > 0) { 97 | addUpdateRowTable.getColumnModel().getColumn(0).setResizable(false); 98 | addUpdateRowTable.getColumnModel().getColumn(1).setResizable(false); 99 | } 100 | 101 | applyButton.setText("Apply"); 102 | applyButton.addActionListener(new java.awt.event.ActionListener() { 103 | public void actionPerformed(java.awt.event.ActionEvent evt) { 104 | applyButtonActionPerformed(evt); 105 | } 106 | }); 107 | 108 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 109 | getContentPane().setLayout(layout); 110 | layout.setHorizontalGroup( 111 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 112 | .addGroup(layout.createSequentialGroup() 113 | .addContainerGap() 114 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 115 | .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 418, Short.MAX_VALUE) 116 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 117 | .addGap(0, 0, Short.MAX_VALUE) 118 | .addComponent(applyButton))) 119 | .addContainerGap()) 120 | ); 121 | layout.setVerticalGroup( 122 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 123 | .addGroup(layout.createSequentialGroup() 124 | .addContainerGap() 125 | .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE) 126 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 127 | .addComponent(applyButton) 128 | .addContainerGap()) 129 | ); 130 | 131 | pack(); 132 | }// </editor-fold>//GEN-END:initComponents 133 | 134 | private void applyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_applyButtonActionPerformed 135 | // TODO add your handling code here: 136 | String status = (row == null ? "add" : "update"); 137 | if (JOptionPane.showConfirmDialog(null, "Are you sure you want to " + status + " this row?", "Row adding/updating", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { 138 | Object[] effectingRow = new Object[columns.length]; 139 | for (int i = 0; i < effectingRow.length; i++) { 140 | effectingRow[i] = defaultTableModel.getValueAt(i, 1); 141 | } 142 | if (row == null) { 143 | rowController.insertRow(effectingRow); 144 | mainTableModel.addRow(effectingRow); 145 | } else { 146 | rowController.updateRow(rowIndex, effectingRow); 147 | for (int i = 0; i < effectingRow.length; i++) { 148 | mainTableModel.setValueAt(effectingRow[i], rowIndex, i); 149 | } 150 | } 151 | dispose(); 152 | } 153 | }//GEN-LAST:event_applyButtonActionPerformed 154 | 155 | // Variables declaration - do not modify//GEN-BEGIN:variables 156 | private javax.swing.JTable addUpdateRowTable; 157 | private javax.swing.JButton applyButton; 158 | private javax.swing.JScrollPane jScrollPane1; 159 | // End of variables declaration//GEN-END:variables 160 | } 161 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/CreateTableDialog.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="2"/> 6 | </Properties> 7 | <SyntheticProperties> 8 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 9 | <SyntheticProperty name="generateCenter" type="boolean" value="false"/> 10 | </SyntheticProperties> 11 | <AuxValues> 12 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 13 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 14 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 15 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 17 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 18 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 19 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 20 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 21 | </AuxValues> 22 | 23 | <Layout> 24 | <DimensionLayout dim="0"> 25 | <Group type="103" groupAlignment="0" attributes="0"> 26 | <Group type="102" attributes="0"> 27 | <EmptySpace max="-2" attributes="0"/> 28 | <Group type="103" groupAlignment="0" attributes="0"> 29 | <Component id="jPanel1" alignment="1" pref="658" max="32767" attributes="0"/> 30 | <Group type="102" alignment="1" attributes="0"> 31 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 32 | <EmptySpace max="-2" attributes="0"/> 33 | <Component id="tableNameTextField" max="32767" attributes="0"/> 34 | </Group> 35 | <Component id="jScrollPane2" alignment="0" max="32767" attributes="0"/> 36 | <Component id="jScrollPane1" alignment="1" max="32767" attributes="0"/> 37 | <Group type="102" alignment="1" attributes="0"> 38 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 39 | <Group type="103" groupAlignment="0" attributes="0"> 40 | <Component id="generateCreateStatementButton" alignment="1" min="-2" max="-2" attributes="0"/> 41 | <Component id="createTablesButton" alignment="1" min="-2" pref="185" max="-2" attributes="0"/> 42 | </Group> 43 | </Group> 44 | </Group> 45 | <EmptySpace max="-2" attributes="0"/> 46 | </Group> 47 | </Group> 48 | </DimensionLayout> 49 | <DimensionLayout dim="1"> 50 | <Group type="103" groupAlignment="0" attributes="0"> 51 | <Group type="102" alignment="0" attributes="0"> 52 | <EmptySpace max="-2" attributes="0"/> 53 | <Group type="103" groupAlignment="3" attributes="0"> 54 | <Component id="tableNameTextField" alignment="3" min="-2" max="-2" attributes="0"/> 55 | <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> 56 | </Group> 57 | <EmptySpace max="-2" attributes="0"/> 58 | <Component id="jPanel1" min="-2" max="-2" attributes="0"/> 59 | <EmptySpace max="-2" attributes="0"/> 60 | <Component id="jScrollPane1" min="-2" pref="158" max="-2" attributes="0"/> 61 | <EmptySpace max="-2" attributes="0"/> 62 | <Component id="generateCreateStatementButton" min="-2" max="-2" attributes="0"/> 63 | <EmptySpace max="-2" attributes="0"/> 64 | <Component id="jScrollPane2" pref="163" max="32767" attributes="0"/> 65 | <EmptySpace max="-2" attributes="0"/> 66 | <Component id="createTablesButton" min="-2" max="-2" attributes="0"/> 67 | <EmptySpace max="-2" attributes="0"/> 68 | </Group> 69 | </Group> 70 | </DimensionLayout> 71 | </Layout> 72 | <SubComponents> 73 | <Component class="javax.swing.JTextField" name="tableNameTextField"> 74 | </Component> 75 | <Component class="javax.swing.JLabel" name="jLabel1"> 76 | <Properties> 77 | <Property name="text" type="java.lang.String" value="Table name : "/> 78 | </Properties> 79 | </Component> 80 | <Container class="javax.swing.JPanel" name="jPanel1"> 81 | 82 | <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout"> 83 | <Property name="columns" type="int" value="4"/> 84 | <Property name="horizontalGap" type="int" value="3"/> 85 | <Property name="rows" type="int" value="1"/> 86 | <Property name="verticalGap" type="int" value="2"/> 87 | </Layout> 88 | <SubComponents> 89 | <Component class="javax.swing.JButton" name="addFieldButton"> 90 | <Properties> 91 | <Property name="text" type="java.lang.String" value="Add Field"/> 92 | </Properties> 93 | <Events> 94 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addFieldButtonActionPerformed"/> 95 | </Events> 96 | </Component> 97 | <Component class="javax.swing.JButton" name="removeFieldButton"> 98 | <Properties> 99 | <Property name="text" type="java.lang.String" value="Remove Field"/> 100 | </Properties> 101 | <Events> 102 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="removeFieldButtonActionPerformed"/> 103 | </Events> 104 | </Component> 105 | <Component class="javax.swing.JButton" name="moveUpButton"> 106 | <Properties> 107 | <Property name="text" type="java.lang.String" value="Move Up"/> 108 | </Properties> 109 | <Events> 110 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="moveUpButtonActionPerformed"/> 111 | </Events> 112 | </Component> 113 | <Component class="javax.swing.JButton" name="moveDownButton"> 114 | <Properties> 115 | <Property name="text" type="java.lang.String" value="Move Down"/> 116 | </Properties> 117 | <Events> 118 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="moveDownButtonActionPerformed"/> 119 | </Events> 120 | </Component> 121 | </SubComponents> 122 | </Container> 123 | <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 124 | <AuxValues> 125 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 126 | </AuxValues> 127 | 128 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 129 | <SubComponents> 130 | <Component class="javax.swing.JTable" name="databaseConfigTable"> 131 | <Properties> 132 | <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 133 | <Table columnCount="8" rowCount="0"> 134 | <Column editable="false" title="#" type="java.lang.Integer"/> 135 | <Column editable="true" title="Field Name" type="java.lang.String"/> 136 | <Column editable="true" title="Type" type="java.lang.Object"/> 137 | <Column editable="true" title="PK" type="java.lang.Boolean"/> 138 | <Column editable="true" title="NN" type="java.lang.Boolean"/> 139 | <Column editable="true" title="AI" type="java.lang.Boolean"/> 140 | <Column editable="true" title="UNI" type="java.lang.Boolean"/> 141 | <Column editable="true" title="Default" type="java.lang.String"/> 142 | </Table> 143 | </Property> 144 | <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 145 | <TableColumnModel selectionModel="0"> 146 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 147 | <Title/> 148 | <Editor/> 149 | <Renderer/> 150 | </Column> 151 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 152 | <Title/> 153 | <Editor/> 154 | <Renderer/> 155 | </Column> 156 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 157 | <Title/> 158 | <Editor/> 159 | <Renderer/> 160 | </Column> 161 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 162 | <Title/> 163 | <Editor/> 164 | <Renderer/> 165 | </Column> 166 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 167 | <Title/> 168 | <Editor/> 169 | <Renderer/> 170 | </Column> 171 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 172 | <Title/> 173 | <Editor/> 174 | <Renderer/> 175 | </Column> 176 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 177 | <Title/> 178 | <Editor/> 179 | <Renderer/> 180 | </Column> 181 | <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> 182 | <Title/> 183 | <Editor/> 184 | <Renderer/> 185 | </Column> 186 | </TableColumnModel> 187 | </Property> 188 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 189 | <TableHeader reorderingAllowed="false" resizingAllowed="true"/> 190 | </Property> 191 | </Properties> 192 | <Events> 193 | <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="databaseConfigTableMousePressed"/> 194 | </Events> 195 | </Component> 196 | </SubComponents> 197 | </Container> 198 | <Container class="javax.swing.JScrollPane" name="jScrollPane2"> 199 | <AuxValues> 200 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 201 | </AuxValues> 202 | 203 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 204 | <SubComponents> 205 | <Component class="javax.swing.JTextArea" name="sqliteQueryTextArea"> 206 | <Properties> 207 | <Property name="editable" type="boolean" value="false"/> 208 | <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 209 | <Color blue="7c" green="7c" red="7c" type="rgb"/> 210 | </Property> 211 | <Property name="columns" type="int" value="20"/> 212 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 213 | <Font name="Miriam Fixed" size="13" style="0"/> 214 | </Property> 215 | <Property name="rows" type="int" value="5"/> 216 | </Properties> 217 | </Component> 218 | </SubComponents> 219 | </Container> 220 | <Component class="javax.swing.JButton" name="createTablesButton"> 221 | <Properties> 222 | <Property name="text" type="java.lang.String" value="Create tables"/> 223 | <Property name="enabled" type="boolean" value="false"/> 224 | </Properties> 225 | <Events> 226 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="createTablesButtonActionPerformed"/> 227 | </Events> 228 | </Component> 229 | <Component class="javax.swing.JButton" name="generateCreateStatementButton"> 230 | <Properties> 231 | <Property name="text" type="java.lang.String" value="Generate Create Statement"/> 232 | </Properties> 233 | <Events> 234 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="generateCreateStatementButtonActionPerformed"/> 235 | </Events> 236 | </Component> 237 | </SubComponents> 238 | </Form> 239 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/HistoryItemPanel.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> 4 | <Events> 5 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseClicked"/> 6 | </Events> 7 | <AuxValues> 8 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 9 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 10 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 11 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 12 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 13 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 14 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 15 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 17 | </AuxValues> 18 | 19 | <Layout> 20 | <DimensionLayout dim="0"> 21 | <Group type="103" groupAlignment="0" attributes="0"> 22 | <Group type="102" alignment="0" attributes="0"> 23 | <EmptySpace max="-2" attributes="0"/> 24 | <Component id="historyIndexLabel" min="-2" pref="34" max="-2" attributes="0"/> 25 | <EmptySpace max="-2" attributes="0"/> 26 | <Component id="queryLabel" pref="380" max="32767" attributes="0"/> 27 | <EmptySpace max="-2" attributes="0"/> 28 | </Group> 29 | <Component id="jSeparator1" alignment="1" max="32767" attributes="0"/> 30 | </Group> 31 | </DimensionLayout> 32 | <DimensionLayout dim="1"> 33 | <Group type="103" groupAlignment="0" attributes="0"> 34 | <Group type="102" alignment="0" attributes="0"> 35 | <Group type="103" groupAlignment="0" attributes="0"> 36 | <Group type="102" attributes="0"> 37 | <EmptySpace min="2" pref="2" max="-2" attributes="0"/> 38 | <Component id="historyIndexLabel" pref="27" max="32767" attributes="0"/> 39 | </Group> 40 | <Component id="queryLabel" max="32767" attributes="0"/> 41 | </Group> 42 | <EmptySpace min="0" pref="0" max="-2" attributes="0"/> 43 | <Component id="jSeparator1" min="-2" pref="6" max="-2" attributes="0"/> 44 | </Group> 45 | </Group> 46 | </DimensionLayout> 47 | </Layout> 48 | <SubComponents> 49 | <Component class="javax.swing.JLabel" name="historyIndexLabel"> 50 | <Properties> 51 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 52 | <Font name="Ubuntu" size="18" style="1"/> 53 | </Property> 54 | <Property name="text" type="java.lang.String" value="999"/> 55 | <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> 56 | <Dimension value="[20, 20]"/> 57 | </Property> 58 | </Properties> 59 | </Component> 60 | <Component class="javax.swing.JLabel" name="queryLabel"> 61 | <Properties> 62 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 63 | <Font name="Ubuntu" size="13" style="0"/> 64 | </Property> 65 | <Property name="text" type="java.lang.String" value="select * from `test_table` where `test_f0` = '123' and..."/> 66 | </Properties> 67 | </Component> 68 | <Component class="javax.swing.JSeparator" name="jSeparator1"> 69 | </Component> 70 | </SubComponents> 71 | </Form> 72 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/HistoryItemPanel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 | */ 17 | package com.clough.android.adbv.view; 18 | 19 | import java.awt.Color; 20 | import javax.swing.JTextArea; 21 | 22 | /** 23 | * 24 | * @author thedathoudarya 25 | */ 26 | public class HistoryItemPanel extends javax.swing.JPanel { 27 | 28 | private final int historyIndex; 29 | private final boolean queryFromConnectedApplication; 30 | private final String query; 31 | private final JTextArea queryingTextArea; 32 | 33 | /** 34 | * Creates new form TestPanel 35 | */ 36 | public HistoryItemPanel(int historyIndex, boolean queryFromConnectedApplication, String query, JTextArea queryingTextArea) { 37 | initComponents(); 38 | this.historyIndex = historyIndex; 39 | this.queryFromConnectedApplication = queryFromConnectedApplication; 40 | this.query = query; 41 | this.queryingTextArea = queryingTextArea; 42 | decorateHistoryItem(); 43 | } 44 | 45 | private void decorateHistoryItem() { 46 | historyIndexLabel.setText(String.valueOf(historyIndex)); 47 | queryLabel.setText(query.replaceAll("\n", " ")); 48 | Color color; 49 | if (queryFromConnectedApplication) { 50 | color = new Color(0, 0, 0); 51 | } else { 52 | color = new Color(100, 100, 100); 53 | } 54 | historyIndexLabel.setForeground(color); 55 | queryLabel.setForeground(color); 56 | } 57 | 58 | /** 59 | * This method is called from within the constructor to initialize the form. 60 | * WARNING: Do NOT modify this code. The content of this method is always 61 | * regenerated by the Form Editor. 62 | */ 63 | @SuppressWarnings("unchecked") 64 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 65 | private void initComponents() { 66 | 67 | historyIndexLabel = new javax.swing.JLabel(); 68 | queryLabel = new javax.swing.JLabel(); 69 | jSeparator1 = new javax.swing.JSeparator(); 70 | 71 | addMouseListener(new java.awt.event.MouseAdapter() { 72 | public void mouseClicked(java.awt.event.MouseEvent evt) { 73 | formMouseClicked(evt); 74 | } 75 | }); 76 | 77 | historyIndexLabel.setFont(new java.awt.Font("Ubuntu", 1, 18)); // NOI18N 78 | historyIndexLabel.setText("999"); 79 | historyIndexLabel.setPreferredSize(new java.awt.Dimension(20, 20)); 80 | 81 | queryLabel.setFont(new java.awt.Font("Ubuntu", 0, 13)); // NOI18N 82 | queryLabel.setText("select * from `test_table` where `test_f0` = '123' and..."); 83 | 84 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); 85 | this.setLayout(layout); 86 | layout.setHorizontalGroup( 87 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 88 | .addGroup(layout.createSequentialGroup() 89 | .addContainerGap() 90 | .addComponent(historyIndexLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) 91 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 92 | .addComponent(queryLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) 93 | .addContainerGap()) 94 | .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING) 95 | ); 96 | layout.setVerticalGroup( 97 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 98 | .addGroup(layout.createSequentialGroup() 99 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 100 | .addGroup(layout.createSequentialGroup() 101 | .addGap(2, 2, 2) 102 | .addComponent(historyIndexLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)) 103 | .addComponent(queryLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 104 | .addGap(0, 0, 0) 105 | .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)) 106 | ); 107 | }// </editor-fold>//GEN-END:initComponents 108 | 109 | private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked 110 | // TODO add your handling code here: 111 | if (evt.getClickCount() == 2) { 112 | queryingTextArea.setText(query); 113 | } 114 | }//GEN-LAST:event_formMouseClicked 115 | 116 | 117 | // Variables declaration - do not modify//GEN-BEGIN:variables 118 | private javax.swing.JLabel historyIndexLabel; 119 | private javax.swing.JSeparator jSeparator1; 120 | private javax.swing.JLabel queryLabel; 121 | // End of variables declaration//GEN-END:variables 122 | } 123 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/TextOutputDialog.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="2"/> 6 | <Property name="title" type="java.lang.String" value="Text Output"/> 7 | </Properties> 8 | <SyntheticProperties> 9 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 10 | <SyntheticProperty name="generateCenter" type="boolean" value="false"/> 11 | </SyntheticProperties> 12 | <AuxValues> 13 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 14 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 15 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 16 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 17 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 18 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 19 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 20 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 21 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 22 | </AuxValues> 23 | 24 | <Layout> 25 | <DimensionLayout dim="0"> 26 | <Group type="103" groupAlignment="0" attributes="0"> 27 | <Component id="jScrollPane2" alignment="0" pref="889" max="32767" attributes="0"/> 28 | </Group> 29 | </DimensionLayout> 30 | <DimensionLayout dim="1"> 31 | <Group type="103" groupAlignment="0" attributes="0"> 32 | <Component id="jScrollPane2" alignment="0" pref="497" max="32767" attributes="0"/> 33 | </Group> 34 | </DimensionLayout> 35 | </Layout> 36 | <SubComponents> 37 | <Container class="javax.swing.JScrollPane" name="jScrollPane2"> 38 | <AuxValues> 39 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 40 | </AuxValues> 41 | 42 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 43 | <SubComponents> 44 | <Component class="javax.swing.JTextPane" name="textOutputTextPane"> 45 | <Properties> 46 | <Property name="editable" type="boolean" value="false"/> 47 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 48 | <Font name="Ubuntu Mono" size="13" style="0"/> 49 | </Property> 50 | </Properties> 51 | </Component> 52 | </SubComponents> 53 | </Container> 54 | </SubComponents> 55 | </Form> 56 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/TextOutputDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 | */ 17 | package com.clough.android.adbv.view; 18 | 19 | import java.awt.Font; 20 | import javax.swing.JTextArea; 21 | 22 | /** 23 | * 24 | * @author thedathoudarya 25 | */ 26 | public class TextOutputDialog extends javax.swing.JDialog { 27 | 28 | /** 29 | * Creates new form TextOutputDialog 30 | */ 31 | public TextOutputDialog(java.awt.Frame parent, String outputText) { 32 | super(parent, true); 33 | initComponents(); 34 | setLocationRelativeTo(null); 35 | // textOutputTextPane.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 18)); 36 | textOutputTextPane.setContentType("text/html"); 37 | textOutputTextPane.setText("" 38 | + "<html>" 39 | + "<body>" 40 | + "<p>" 41 | + "<tt>"+outputText.replaceAll(" ", " ").replaceAll("\n", "<br>")+"</tt>" 42 | + "</p>" 43 | + "</body>" 44 | + "</html>" 45 | + ""); 46 | } 47 | 48 | /** 49 | * This method is called from within the constructor to initialize the form. 50 | * WARNING: Do NOT modify this code. The content of this method is always 51 | * regenerated by the Form Editor. 52 | */ 53 | @SuppressWarnings("unchecked") 54 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 55 | private void initComponents() { 56 | 57 | jScrollPane2 = new javax.swing.JScrollPane(); 58 | textOutputTextPane = new javax.swing.JTextPane(); 59 | 60 | setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 61 | setTitle("Text Output"); 62 | 63 | textOutputTextPane.setEditable(false); 64 | textOutputTextPane.setFont(new java.awt.Font("Ubuntu Mono", 0, 13)); // NOI18N 65 | jScrollPane2.setViewportView(textOutputTextPane); 66 | 67 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 68 | getContentPane().setLayout(layout); 69 | layout.setHorizontalGroup( 70 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 71 | .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 889, Short.MAX_VALUE) 72 | ); 73 | layout.setVerticalGroup( 74 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 75 | .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE) 76 | ); 77 | 78 | pack(); 79 | }// </editor-fold>//GEN-END:initComponents 80 | 81 | // Variables declaration - do not modify//GEN-BEGIN:variables 82 | private javax.swing.JScrollPane jScrollPane2; 83 | private javax.swing.JTextPane textOutputTextPane; 84 | // End of variables declaration//GEN-END:variables 85 | } 86 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/UpdateTableDialog.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="2"/> 6 | </Properties> 7 | <SyntheticProperties> 8 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 9 | <SyntheticProperty name="generateCenter" type="boolean" value="false"/> 10 | </SyntheticProperties> 11 | <AuxValues> 12 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 13 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 14 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 15 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 17 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 18 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 19 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 20 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 21 | </AuxValues> 22 | 23 | <Layout> 24 | <DimensionLayout dim="0"> 25 | <Group type="103" groupAlignment="0" attributes="0"> 26 | <Group type="102" attributes="0"> 27 | <EmptySpace max="-2" attributes="0"/> 28 | <Group type="103" groupAlignment="0" attributes="0"> 29 | <Group type="102" alignment="0" attributes="0"> 30 | <EmptySpace min="0" pref="350" max="32767" attributes="0"/> 31 | <Component id="applyChangesButton" min="-2" max="-2" attributes="0"/> 32 | </Group> 33 | <Component id="jPanel1" alignment="1" max="32767" attributes="0"/> 34 | </Group> 35 | <EmptySpace max="-2" attributes="0"/> 36 | </Group> 37 | </Group> 38 | </DimensionLayout> 39 | <DimensionLayout dim="1"> 40 | <Group type="103" groupAlignment="0" attributes="0"> 41 | <Group type="102" alignment="0" attributes="0"> 42 | <EmptySpace max="-2" attributes="0"/> 43 | <Component id="jPanel1" max="32767" attributes="0"/> 44 | <EmptySpace type="unrelated" max="-2" attributes="0"/> 45 | <Component id="applyChangesButton" min="-2" max="-2" attributes="0"/> 46 | <EmptySpace max="-2" attributes="0"/> 47 | </Group> 48 | </Group> 49 | </DimensionLayout> 50 | </Layout> 51 | <SubComponents> 52 | <Container class="javax.swing.JPanel" name="jPanel1"> 53 | <Properties> 54 | <Property name="autoscrolls" type="boolean" value="true"/> 55 | </Properties> 56 | 57 | <Layout> 58 | <DimensionLayout dim="0"> 59 | <Group type="103" groupAlignment="0" attributes="0"> 60 | <Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/> 61 | </Group> 62 | </DimensionLayout> 63 | <DimensionLayout dim="1"> 64 | <Group type="103" groupAlignment="0" attributes="0"> 65 | <Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/> 66 | </Group> 67 | </DimensionLayout> 68 | </Layout> 69 | <SubComponents> 70 | <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 71 | <AuxValues> 72 | <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> 73 | </AuxValues> 74 | 75 | <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> 76 | <SubComponents> 77 | <Component class="javax.swing.JTable" name="resultTable"> 78 | <Properties> 79 | <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> 80 | <Table columnCount="0" rowCount="0"/> 81 | </Property> 82 | <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> 83 | <TableColumnModel selectionModel="0"/> 84 | </Property> 85 | <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> 86 | <TableHeader reorderingAllowed="false" resizingAllowed="true"/> 87 | </Property> 88 | </Properties> 89 | <Events> 90 | <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="resultTableMouseClicked"/> 91 | </Events> 92 | </Component> 93 | </SubComponents> 94 | </Container> 95 | </SubComponents> 96 | </Container> 97 | <Component class="javax.swing.JButton" name="applyChangesButton"> 98 | <Properties> 99 | <Property name="text" type="java.lang.String" value="Apply changes"/> 100 | </Properties> 101 | <Events> 102 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="applyChangesButtonActionPerformed"/> 103 | </Events> 104 | </Component> 105 | </SubComponents> 106 | </Form> 107 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/WaitingDialog.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="0"/> 6 | <Property name="undecorated" type="boolean" value="true"/> 7 | <Property name="resizable" type="boolean" value="false"/> 8 | </Properties> 9 | <SyntheticProperties> 10 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 11 | <SyntheticProperty name="generateCenter" type="boolean" value="false"/> 12 | </SyntheticProperties> 13 | <AuxValues> 14 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 15 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 16 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 17 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 18 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 19 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 20 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 21 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 22 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 23 | </AuxValues> 24 | 25 | <Layout> 26 | <DimensionLayout dim="0"> 27 | <Group type="103" groupAlignment="0" attributes="0"> 28 | <Group type="102" alignment="1" attributes="0"> 29 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 30 | <EmptySpace max="-2" attributes="0"/> 31 | <Component id="progressBar" pref="373" max="32767" attributes="0"/> 32 | <EmptySpace max="-2" attributes="0"/> 33 | </Group> 34 | </Group> 35 | </DimensionLayout> 36 | <DimensionLayout dim="1"> 37 | <Group type="103" groupAlignment="0" attributes="0"> 38 | <Group type="102" alignment="0" attributes="0"> 39 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 40 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 41 | </Group> 42 | <Group type="102" alignment="1" attributes="0"> 43 | <EmptySpace max="32767" attributes="0"/> 44 | <Component id="progressBar" min="-2" pref="30" max="-2" attributes="0"/> 45 | <EmptySpace min="-2" pref="19" max="-2" attributes="0"/> 46 | </Group> 47 | </Group> 48 | </DimensionLayout> 49 | </Layout> 50 | <SubComponents> 51 | <Component class="javax.swing.JProgressBar" name="progressBar"> 52 | <Properties> 53 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 54 | <Font name="Tahoma" size="14" style="0"/> 55 | </Property> 56 | </Properties> 57 | </Component> 58 | <Component class="javax.swing.JLabel" name="jLabel1"> 59 | <Properties> 60 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 61 | <Image iconType="3" name="/icons/application_icon_2.png"/> 62 | </Property> 63 | </Properties> 64 | </Component> 65 | </SubComponents> 66 | </Form> 67 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/WaitingDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 | */ 17 | package com.clough.android.adbv.view; 18 | 19 | import com.clough.android.adbv.util.ValueHolder; 20 | 21 | /** 22 | * 23 | * @author thedathoudarya 24 | */ 25 | public class WaitingDialog extends javax.swing.JDialog { 26 | 27 | private boolean interminidate; 28 | 29 | /** 30 | * Creates new form WaitingDialog 31 | */ 32 | public WaitingDialog(java.awt.Frame parent) { 33 | super(parent, true); 34 | initComponents(); 35 | setTitle(ValueHolder.WINDOW_TITLE); 36 | } 37 | 38 | public WaitingDialog(java.awt.Frame parent, boolean interminidate, int maxProgressValue, String message) { 39 | this(parent); 40 | this.interminidate = interminidate; 41 | if (interminidate) { 42 | progressBar.setIndeterminate(true); 43 | } else { 44 | progressBar.setMaximum(maxProgressValue); 45 | } 46 | progressBar.setString(message); 47 | progressBar.setStringPainted(true); 48 | setLocationRelativeTo(null); 49 | } 50 | 51 | public void incrementProgressBar() { 52 | if (!interminidate) { 53 | int value = progressBar.getValue(); 54 | progressBar.setValue(++value); 55 | } 56 | } 57 | 58 | /** 59 | * This method is called from within the constructor to initialize the form. 60 | * WARNING: Do NOT modify this code. The content of this method is always 61 | * regenerated by the Form Editor. 62 | */ 63 | @SuppressWarnings("unchecked") 64 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 65 | private void initComponents() { 66 | 67 | progressBar = new javax.swing.JProgressBar(); 68 | jLabel1 = new javax.swing.JLabel(); 69 | 70 | setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); 71 | setUndecorated(true); 72 | setResizable(false); 73 | 74 | progressBar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N 75 | 76 | jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/application_icon_2.png"))); // NOI18N 77 | 78 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 79 | getContentPane().setLayout(layout); 80 | layout.setHorizontalGroup( 81 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 82 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 83 | .addComponent(jLabel1) 84 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 85 | .addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE) 86 | .addContainerGap()) 87 | ); 88 | layout.setVerticalGroup( 89 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 90 | .addGroup(layout.createSequentialGroup() 91 | .addComponent(jLabel1) 92 | .addGap(0, 0, Short.MAX_VALUE)) 93 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 94 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 95 | .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) 96 | .addGap(19, 19, 19)) 97 | ); 98 | 99 | pack(); 100 | }// </editor-fold>//GEN-END:initComponents 101 | 102 | // Variables declaration - do not modify//GEN-BEGIN:variables 103 | private javax.swing.JLabel jLabel1; 104 | private javax.swing.JProgressBar progressBar; 105 | // End of variables declaration//GEN-END:variables 106 | } 107 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/WaitingForDeviceDialog.form: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8" ?> 2 | 3 | <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 4 | <Properties> 5 | <Property name="defaultCloseOperation" type="int" value="3"/> 6 | <Property name="title" type="java.lang.String" value="Android DB Viewer"/> 7 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 8 | <Color blue="ff" green="a6" red="0" type="rgb"/> 9 | </Property> 10 | <Property name="resizable" type="boolean" value="false"/> 11 | </Properties> 12 | <SyntheticProperties> 13 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 14 | <SyntheticProperty name="generateCenter" type="boolean" value="false"/> 15 | </SyntheticProperties> 16 | <AuxValues> 17 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> 18 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> 19 | <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> 20 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> 21 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> 22 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> 23 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> 24 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> 25 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> 26 | </AuxValues> 27 | 28 | <Layout> 29 | <DimensionLayout dim="0"> 30 | <Group type="103" groupAlignment="0" attributes="0"> 31 | <Group type="102" alignment="1" attributes="0"> 32 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 33 | <EmptySpace type="unrelated" max="-2" attributes="0"/> 34 | <Group type="103" groupAlignment="0" attributes="0"> 35 | <Group type="102" attributes="0"> 36 | <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 37 | <EmptySpace pref="142" max="32767" attributes="0"/> 38 | <Component id="jLabel4" min="-2" max="-2" attributes="0"/> 39 | </Group> 40 | <Component id="jProgressBar1" max="32767" attributes="0"/> 41 | </Group> 42 | <EmptySpace max="-2" attributes="0"/> 43 | </Group> 44 | </Group> 45 | </DimensionLayout> 46 | <DimensionLayout dim="1"> 47 | <Group type="103" groupAlignment="0" attributes="0"> 48 | <Group type="102" alignment="1" attributes="0"> 49 | <EmptySpace max="-2" attributes="0"/> 50 | <Component id="jProgressBar1" min="-2" pref="24" max="-2" attributes="0"/> 51 | <EmptySpace max="-2" attributes="0"/> 52 | <Group type="103" groupAlignment="3" attributes="0"> 53 | <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> 54 | <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> 55 | </Group> 56 | <EmptySpace max="32767" attributes="0"/> 57 | </Group> 58 | <Group type="102" alignment="0" attributes="0"> 59 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 60 | <EmptySpace min="0" pref="0" max="32767" attributes="0"/> 61 | </Group> 62 | </Group> 63 | </DimensionLayout> 64 | </Layout> 65 | <SubComponents> 66 | <Component class="javax.swing.JLabel" name="jLabel2"> 67 | <Properties> 68 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 69 | <Font name="Ubuntu" size="11" style="0"/> 70 | </Property> 71 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 72 | <Color blue="5b" green="5b" red="5b" type="rgb"/> 73 | </Property> 74 | <Property name="horizontalAlignment" type="int" value="2"/> 75 | <Property name="text" type="java.lang.String" value="Copyright © 2016 by CLOUGH"/> 76 | <Property name="name" type="java.lang.String" value="" noResource="true"/> 77 | </Properties> 78 | </Component> 79 | <Component class="javax.swing.JProgressBar" name="jProgressBar1"> 80 | <Properties> 81 | <Property name="indeterminate" type="boolean" value="true"/> 82 | <Property name="string" type="java.lang.String" value="Connecting to a device"/> 83 | <Property name="stringPainted" type="boolean" value="true"/> 84 | </Properties> 85 | </Component> 86 | <Component class="javax.swing.JLabel" name="jLabel4"> 87 | <Properties> 88 | <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> 89 | <Font name="Ubuntu" size="11" style="0"/> 90 | </Property> 91 | <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> 92 | <Color blue="5b" green="5b" red="5b" type="rgb"/> 93 | </Property> 94 | <Property name="horizontalAlignment" type="int" value="4"/> 95 | <Property name="text" type="java.lang.String" value="All Rights Reserved."/> 96 | <Property name="name" type="java.lang.String" value="SS4A" noResource="true"/> 97 | </Properties> 98 | </Component> 99 | <Component class="javax.swing.JLabel" name="jLabel1"> 100 | <Properties> 101 | <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> 102 | <Image iconType="3" name="/icons/application_icon_2.png"/> 103 | </Property> 104 | </Properties> 105 | </Component> 106 | </SubComponents> 107 | </Form> 108 | -------------------------------------------------------------------------------- /netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/view/WaitingForDeviceDialog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 thedathoudarya 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 | */ 17 | package com.clough.android.adbv.view; 18 | 19 | import com.clough.android.adbv.util.ValueHolder; 20 | 21 | // View that keep displaying until desktop application connect with an android application. 22 | public class WaitingForDeviceDialog extends javax.swing.JFrame { 23 | 24 | /** 25 | * Creates new form WaitingForDeviceDialog 26 | */ 27 | public WaitingForDeviceDialog() { 28 | super(); 29 | initComponents(); 30 | setLocationRelativeTo(null); 31 | setTitle(ValueHolder.WINDOW_TITLE); 32 | setIconImage(ValueHolder.Icons.APPLICATION.getImage()); 33 | } 34 | 35 | /** 36 | * This method is called from within the constructor to initialize the form. 37 | * WARNING: Do NOT modify this code. The content of this method is always 38 | * regenerated by the Form Editor. 39 | */ 40 | @SuppressWarnings("unchecked") 41 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 42 | private void initComponents() { 43 | 44 | jLabel2 = new javax.swing.JLabel(); 45 | jProgressBar1 = new javax.swing.JProgressBar(); 46 | jLabel4 = new javax.swing.JLabel(); 47 | jLabel1 = new javax.swing.JLabel(); 48 | 49 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 50 | setTitle("Android DB Viewer"); 51 | setForeground(new java.awt.Color(0, 166, 255)); 52 | setResizable(false); 53 | 54 | jLabel2.setFont(new java.awt.Font("Ubuntu", 0, 11)); // NOI18N 55 | jLabel2.setForeground(new java.awt.Color(91, 91, 91)); 56 | jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); 57 | jLabel2.setText("Copyright © 2016 by CLOUGH"); 58 | jLabel2.setName(""); // NOI18N 59 | 60 | jProgressBar1.setIndeterminate(true); 61 | jProgressBar1.setString("Connecting to a device"); 62 | jProgressBar1.setStringPainted(true); 63 | 64 | jLabel4.setFont(new java.awt.Font("Ubuntu", 0, 11)); // NOI18N 65 | jLabel4.setForeground(new java.awt.Color(91, 91, 91)); 66 | jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 67 | jLabel4.setText("All Rights Reserved."); 68 | jLabel4.setName("SS4A"); // NOI18N 69 | 70 | jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/application_icon_2.png"))); // NOI18N 71 | 72 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 73 | getContentPane().setLayout(layout); 74 | layout.setHorizontalGroup( 75 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 76 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 77 | .addComponent(jLabel1) 78 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 79 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 80 | .addGroup(layout.createSequentialGroup() 81 | .addComponent(jLabel2) 82 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 142, Short.MAX_VALUE) 83 | .addComponent(jLabel4)) 84 | .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 85 | .addContainerGap()) 86 | ); 87 | layout.setVerticalGroup( 88 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 89 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 90 | .addContainerGap() 91 | .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) 92 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 93 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 94 | .addComponent(jLabel2) 95 | .addComponent(jLabel4)) 96 | .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 97 | .addGroup(layout.createSequentialGroup() 98 | .addComponent(jLabel1) 99 | .addGap(0, 0, Short.MAX_VALUE)) 100 | ); 101 | 102 | pack(); 103 | }// </editor-fold>//GEN-END:initComponents 104 | 105 | 106 | // Variables declaration - do not modify//GEN-BEGIN:variables 107 | private javax.swing.JLabel jLabel1; 108 | private javax.swing.JLabel jLabel2; 109 | private javax.swing.JLabel jLabel4; 110 | private javax.swing.JProgressBar jProgressBar1; 111 | // End of variables declaration//GEN-END:variables 112 | } 113 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/.name: -------------------------------------------------------------------------------- 1 | ADBVTestApp -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="CompilerConfiguration"> 4 | <resourceExtensions /> 5 | <wildcardResourcePatterns> 6 | <entry name="!?*.java" /> 7 | <entry name="!?*.form" /> 8 | <entry name="!?*.class" /> 9 | <entry name="!?*.groovy" /> 10 | <entry name="!?*.scala" /> 11 | <entry name="!?*.flex" /> 12 | <entry name="!?*.kt" /> 13 | <entry name="!?*.clj" /> 14 | <entry name="!?*.aj" /> 15 | </wildcardResourcePatterns> 16 | <annotationProcessing> 17 | <profile default="true" name="Default" enabled="false"> 18 | <processorPath useClasspath="true" /> 19 | </profile> 20 | </annotationProcessing> 21 | </component> 22 | </project> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | <component name="CopyrightManager"> 2 | <settings default="" /> 3 | </component> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="Encoding"> 4 | <file url="PROJECT" charset="UTF-8" /> 5 | </component> 6 | </project> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="GradleSettings"> 4 | <option name="linkedExternalProjectsSettings"> 5 | <GradleProjectSettings> 6 | <option name="distributionType" value="DEFAULT_WRAPPED" /> 7 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> 8 | <option name="gradleJvm" value="1.8" /> 9 | <option name="modules"> 10 | <set> 11 | <option value="$PROJECT_DIR$" /> 12 | <option value="$PROJECT_DIR$/app" /> 13 | </set> 14 | </option> 15 | </GradleProjectSettings> 16 | </option> 17 | </component> 18 | </project> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="EntryPointsManager"> 4 | <entry_points version="2.0" /> 5 | </component> 6 | <component name="NullableNotNullManager"> 7 | <option name="myDefaultNullable" value="android.support.annotation.Nullable" /> 8 | <option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> 9 | <option name="myNullables"> 10 | <value> 11 | <list size="4"> 12 | <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" /> 13 | <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" /> 14 | <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" /> 15 | <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" /> 16 | </list> 17 | </value> 18 | </option> 19 | <option name="myNotNulls"> 20 | <value> 21 | <list size="4"> 22 | <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" /> 23 | <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" /> 24 | <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" /> 25 | <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" /> 26 | </list> 27 | </value> 28 | </option> 29 | </component> 30 | <component name="ProjectLevelVcsManager" settingsEditedManually="false"> 31 | <OptionsSetting value="true" id="Add" /> 32 | <OptionsSetting value="true" id="Remove" /> 33 | <OptionsSetting value="true" id="Checkout" /> 34 | <OptionsSetting value="true" id="Update" /> 35 | <OptionsSetting value="true" id="Status" /> 36 | <OptionsSetting value="true" id="Edit" /> 37 | <ConfirmationsSetting value="0" id="Add" /> 38 | <ConfirmationsSetting value="0" id="Remove" /> 39 | </component> 40 | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> 41 | <output url="file://$PROJECT_DIR$/build/classes" /> 42 | </component> 43 | <component name="ProjectType"> 44 | <option name="id" value="Android" /> 45 | </component> 46 | </project> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="ProjectModuleManager"> 4 | <modules> 5 | <module fileurl="file://$PROJECT_DIR$/ADBVTestApp.iml" filepath="$PROJECT_DIR$/ADBVTestApp.iml" /> 6 | <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" /> 7 | </modules> 8 | </component> 9 | </project> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="RunConfigurationProducerService"> 4 | <option name="ignoredProducers"> 5 | <set> 6 | <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" /> 7 | <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" /> 8 | <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" /> 9 | </set> 10 | </option> 11 | </component> 12 | </project> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <project version="4"> 3 | <component name="VcsDirectoryMappings"> 4 | <mapping directory="" vcs="" /> 5 | </component> 6 | </project> -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | applicationId "com.clough.android.adbvtestapp" 9 | minSdkVersion 14 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | repositories { 23 | maven { 24 | url 'https://dl.bintray.com/clough/maven' 25 | } 26 | } 27 | 28 | 29 | dependencies { 30 | compile fileTree(dir: 'libs', include: ['*.jar']) 31 | testCompile 'junit:junit:4.12' 32 | compile 'com.android.support:appcompat-v7:23.2.0' 33 | compile 'com.clough.android.androiddbviewer:androiddbviewer:1.0.0' 34 | } 35 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Thedath Oudarya\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/androidTest/java/com/clough/android/adbvtestapp/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.clough.android.adbvtestapp; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase<Application> { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <manifest xmlns:android="http://schemas.android.com/apk/res/android" 3 | package="com.clough.android.adbvtestapp"> 4 | 5 | <application 6 | android:name=".CustomApplication" 7 | android:allowBackup="true" 8 | android:icon="@mipmap/ic_launcher" 9 | android:label="@string/app_name" 10 | android:supportsRtl="true" 11 | android:theme="@style/AppTheme"> 12 | <activity android:name=".MainActivity"> 13 | <intent-filter> 14 | <action android:name="android.intent.action.MAIN" /> 15 | 16 | <category android:name="android.intent.category.LAUNCHER" /> 17 | </intent-filter> 18 | </activity> 19 | </application> 20 | 21 | </manifest> 22 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/java/com/clough/android/adbvtestapp/CustomApplication.java: -------------------------------------------------------------------------------- 1 | package com.clough.android.adbvtestapp; 2 | 3 | import android.database.sqlite.SQLiteOpenHelper; 4 | 5 | import com.clough.android.androiddbviewer.ADBVApplication; 6 | 7 | /** 8 | * Created by Thedath Oudarya on 3/2/2016. 9 | */ 10 | public class CustomApplication extends ADBVApplication { 11 | @Override 12 | public SQLiteOpenHelper getDataBase() { 13 | return new DatabaseHelper(getApplicationContext()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/java/com/clough/android/adbvtestapp/DatabaseHelper.java: -------------------------------------------------------------------------------- 1 | package com.clough.android.adbvtestapp; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteOpenHelper; 6 | 7 | /** 8 | * Created by Thedath Oudarya on 3/2/2016. 9 | */ 10 | public class DatabaseHelper extends SQLiteOpenHelper { 11 | public DatabaseHelper(Context context) { 12 | super(context, "test_db", null, 1); 13 | } 14 | 15 | @Override 16 | public void onCreate(SQLiteDatabase db) { 17 | // create tables 18 | } 19 | 20 | @Override 21 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 22 | // drop, alter tables 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/java/com/clough/android/adbvtestapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.clough.android.adbvtestapp; 2 | 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.os.Bundle; 5 | 6 | public class MainActivity extends AppCompatActivity { 7 | 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | setContentView(R.layout.activity_main); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 | xmlns:tools="http://schemas.android.com/tools" 4 | android:layout_width="match_parent" 5 | android:layout_height="match_parent" 6 | android:paddingBottom="@dimen/activity_vertical_margin" 7 | android:paddingLeft="@dimen/activity_horizontal_margin" 8 | android:paddingRight="@dimen/activity_horizontal_margin" 9 | android:paddingTop="@dimen/activity_vertical_margin" 10 | tools:context="com.clough.android.adbvtestapp.MainActivity"> 11 | 12 | <TextView 13 | android:layout_width="wrap_content" 14 | android:layout_height="wrap_content" 15 | android:text="Hello World!" /> 16 | </RelativeLayout> 17 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/sample-app/ADBVTestApp/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/sample-app/ADBVTestApp/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/sample-app/ADBVTestApp/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/sample-app/ADBVTestApp/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thedathoudarya/AndroidDBvieweR/1d7b35b6ed669463ba2702a94fbce9b636cdd999/sample-app/ADBVTestApp/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | <!-- Example customization of dimensions originally defined in res/values/dimens.xml 3 | (such as screen margins) for screens with more than 820dp of available width. This 4 | would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> 5 | <dimen name="activity_horizontal_margin">64dp</dimen> 6 | </resources> 7 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="utf-8"?> 2 | <resources> 3 | <color name="colorPrimary">#3F51B5</color> 4 | <color name="colorPrimaryDark">#303F9F</color> 5 | <color name="colorAccent">#FF4081</color> 6 | </resources> 7 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | <!-- Default screen margins, per the Android Design guidelines. --> 3 | <dimen name="activity_horizontal_margin">16dp</dimen> 4 | <dimen name="activity_vertical_margin">16dp</dimen> 5 | </resources> 6 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | <string name="app_name">ADBVTestApp</string> 3 | </resources> 4 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | <resources> 2 | 3 | <!-- Base application theme. --> 4 | <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 5 | <!-- Customize your theme here. --> 6 | <item name="colorPrimary">@color/colorPrimary</item> 7 | <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 8 | <item name="colorAccent">@color/colorAccent</item> 9 | </style> 10 | 11 | </resources> 12 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/app/src/test/java/com/clough/android/adbvtestapp/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.clough.android.adbvtestapp; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | jcenter() 15 | } 16 | } 17 | 18 | task clean(type: Delete) { 19 | delete rootProject.buildDir 20 | } 21 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 21 11:34:03 PDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip 7 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /sample-app/ADBVTestApp/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------