Commit 44d758ae by User

added project directory

parents
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<DBN-PSQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false" />
</DBN-PSQL>
<DBN-SQL>
<case-options enabled="true">
<option name="KEYWORD_CASE" value="lower" />
<option name="FUNCTION_CASE" value="lower" />
<option name="PARAMETER_CASE" value="lower" />
<option name="DATATYPE_CASE" value="lower" />
<option name="OBJECT_CASE" value="preserve" />
</case-options>
<formatting-settings enabled="false">
<option name="STATEMENT_SPACING" value="one_line" />
<option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
<option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
</formatting-settings>
</DBN-SQL>
<codeStyleSettings language="XML">
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DBNavigator.Project.DataEditorManager">
<record-view-column-sorting-type value="BY_INDEX" />
<value-preview-text-wrapping value="true" />
<value-preview-pinned value="false" />
</component>
<component name="DBNavigator.Project.DataExportManager">
<export-instructions>
<create-header value="true" />
<quote-values-containing-separator value="true" />
<quote-all-values value="false" />
<value-separator value="" />
<file-name value="" />
<file-location value="" />
<scope value="GLOBAL" />
<destination value="FILE" />
<format value="EXCEL" />
<charset value="windows-1252" />
</export-instructions>
</component>
<component name="DBNavigator.Project.DatabaseBrowserManager">
<autoscroll-to-editor value="false" />
<autoscroll-from-editor value="true" />
<show-object-properties value="true" />
<loaded-nodes />
</component>
<component name="DBNavigator.Project.DatabaseFileManager">
<open-files />
</component>
<component name="DBNavigator.Project.EditorStateManager">
<last-used-providers />
</component>
<component name="DBNavigator.Project.MethodExecutionManager">
<method-browser />
<execution-history>
<group-entries value="true" />
<execution-inputs />
</execution-history>
<argument-values-cache />
</component>
<component name="DBNavigator.Project.ObjectDependencyManager">
<last-used-dependency-type value="INCOMING" />
</component>
<component name="DBNavigator.Project.ObjectQuickFilterManager">
<last-used-operator value="EQUAL" />
<filters />
</component>
<component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true">
<recently-used-interfaces />
</component>
<component name="DBNavigator.Project.Settings">
<connections />
<browser-settings>
<general>
<display-mode value="TABBED" />
<navigation-history-size value="100" />
<show-object-details value="false" />
</general>
<filters>
<object-type-filter>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="true" />
<object-type name="ROLE" enabled="true" />
<object-type name="PRIVILEGE" enabled="true" />
<object-type name="CHARSET" enabled="true" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED_VIEW" enabled="true" />
<object-type name="NESTED_TABLE" enabled="true" />
<object-type name="COLUMN" enabled="true" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET_TRIGGER" enabled="true" />
<object-type name="DATABASE_TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="true" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE_ATTRIBUTE" enabled="true" />
<object-type name="ARGUMENT" enabled="true" />
<object-type name="DIMENSION" enabled="true" />
<object-type name="CLUSTER" enabled="true" />
<object-type name="DBLINK" enabled="true" />
</object-type-filter>
</filters>
<sorting>
<object-type name="COLUMN" sorting-type="NAME" />
<object-type name="FUNCTION" sorting-type="NAME" />
<object-type name="PROCEDURE" sorting-type="NAME" />
<object-type name="ARGUMENT" sorting-type="POSITION" />
</sorting>
<default-editors>
<object-type name="VIEW" editor-type="SELECTION" />
<object-type name="PACKAGE" editor-type="SELECTION" />
<object-type name="TYPE" editor-type="SELECTION" />
</default-editors>
</browser-settings>
<navigation-settings>
<lookup-filters>
<lookup-objects>
<object-type name="SCHEMA" enabled="true" />
<object-type name="USER" enabled="false" />
<object-type name="ROLE" enabled="false" />
<object-type name="PRIVILEGE" enabled="false" />
<object-type name="CHARSET" enabled="false" />
<object-type name="TABLE" enabled="true" />
<object-type name="VIEW" enabled="true" />
<object-type name="MATERIALIZED VIEW" enabled="true" />
<object-type name="NESTED TABLE" enabled="false" />
<object-type name="COLUMN" enabled="false" />
<object-type name="INDEX" enabled="true" />
<object-type name="CONSTRAINT" enabled="true" />
<object-type name="DATASET TRIGGER" enabled="true" />
<object-type name="DATABASE TRIGGER" enabled="true" />
<object-type name="SYNONYM" enabled="false" />
<object-type name="SEQUENCE" enabled="true" />
<object-type name="PROCEDURE" enabled="true" />
<object-type name="FUNCTION" enabled="true" />
<object-type name="PACKAGE" enabled="true" />
<object-type name="TYPE" enabled="true" />
<object-type name="TYPE ATTRIBUTE" enabled="false" />
<object-type name="ARGUMENT" enabled="false" />
<object-type name="DIMENSION" enabled="false" />
<object-type name="CLUSTER" enabled="false" />
<object-type name="DBLINK" enabled="true" />
</lookup-objects>
<force-database-load value="false" />
<prompt-connection-selection value="true" />
<prompt-schema-selection value="true" />
</lookup-filters>
</navigation-settings>
<dataset-grid-settings>
<general>
<enable-zooming value="true" />
<enable-column-tooltip value="true" />
</general>
<sorting>
<nulls-first value="true" />
<max-sorting-columns value="4" />
</sorting>
<tracking-columns>
<columnNames value="" />
<visible value="true" />
<editable value="false" />
</tracking-columns>
</dataset-grid-settings>
<dataset-editor-settings>
<text-editor-popup>
<active value="false" />
<active-if-empty value="false" />
<data-length-threshold value="100" />
<popup-delay value="1000" />
</text-editor-popup>
<values-actions-popup>
<show-popup-button value="true" />
<element-count-threshold value="1000" />
<data-length-threshold value="250" />
</values-actions-popup>
<general>
<fetch-block-size value="100" />
<fetch-timeout value="30" />
<trim-whitespaces value="true" />
<convert-empty-strings-to-null value="true" />
<select-content-on-cell-edit value="true" />
<large-value-preview-active value="true" />
</general>
<filters>
<prompt-filter-dialog value="true" />
<default-filter-type value="BASIC" />
</filters>
<qualified-text-editor text-length-threshold="300">
<content-types>
<content-type name="Text" enabled="true" />
<content-type name="Properties" enabled="true" />
<content-type name="XML" enabled="true" />
<content-type name="DTD" enabled="true" />
<content-type name="HTML" enabled="true" />
<content-type name="XHTML" enabled="true" />
<content-type name="Java" enabled="true" />
<content-type name="Groovy" enabled="true" />
<content-type name="AIDL" enabled="true" />
<content-type name="YAML" enabled="true" />
<content-type name="Manifest" enabled="true" />
</content-types>
</qualified-text-editor>
<record-navigation>
<navigation-target value="VIEWER" />
</record-navigation>
</dataset-editor-settings>
<code-editor-settings>
<general>
<show-object-navigation-gutter value="false" />
<show-spec-declaration-navigation-gutter value="true" />
<enable-spellchecking value="true" />
<enable-reference-spellchecking value="false" />
</general>
<confirmations>
<save-changes value="false" />
<revert-changes value="true" />
</confirmations>
</code-editor-settings>
<code-completion-settings>
<filters>
<basic-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="false" />
<filter-element type="OBJECT" id="view" selected="false" />
<filter-element type="OBJECT" id="materialized view" selected="false" />
<filter-element type="OBJECT" id="index" selected="false" />
<filter-element type="OBJECT" id="constraint" selected="false" />
<filter-element type="OBJECT" id="trigger" selected="false" />
<filter-element type="OBJECT" id="synonym" selected="false" />
<filter-element type="OBJECT" id="sequence" selected="false" />
<filter-element type="OBJECT" id="procedure" selected="false" />
<filter-element type="OBJECT" id="function" selected="false" />
<filter-element type="OBJECT" id="package" selected="false" />
<filter-element type="OBJECT" id="type" selected="false" />
<filter-element type="OBJECT" id="dimension" selected="false" />
<filter-element type="OBJECT" id="cluster" selected="false" />
<filter-element type="OBJECT" id="dblink" selected="false" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</basic-filter>
<extended-filter>
<filter-element type="RESERVED_WORD" id="keyword" selected="true" />
<filter-element type="RESERVED_WORD" id="function" selected="true" />
<filter-element type="RESERVED_WORD" id="parameter" selected="true" />
<filter-element type="RESERVED_WORD" id="datatype" selected="true" />
<filter-element type="RESERVED_WORD" id="exception" selected="true" />
<filter-element type="OBJECT" id="schema" selected="true" />
<filter-element type="OBJECT" id="user" selected="true" />
<filter-element type="OBJECT" id="role" selected="true" />
<filter-element type="OBJECT" id="privilege" selected="true" />
<user-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</user-schema>
<public-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</public-schema>
<any-schema>
<filter-element type="OBJECT" id="table" selected="true" />
<filter-element type="OBJECT" id="view" selected="true" />
<filter-element type="OBJECT" id="materialized view" selected="true" />
<filter-element type="OBJECT" id="index" selected="true" />
<filter-element type="OBJECT" id="constraint" selected="true" />
<filter-element type="OBJECT" id="trigger" selected="true" />
<filter-element type="OBJECT" id="synonym" selected="true" />
<filter-element type="OBJECT" id="sequence" selected="true" />
<filter-element type="OBJECT" id="procedure" selected="true" />
<filter-element type="OBJECT" id="function" selected="true" />
<filter-element type="OBJECT" id="package" selected="true" />
<filter-element type="OBJECT" id="type" selected="true" />
<filter-element type="OBJECT" id="dimension" selected="true" />
<filter-element type="OBJECT" id="cluster" selected="true" />
<filter-element type="OBJECT" id="dblink" selected="true" />
</any-schema>
</extended-filter>
</filters>
<sorting enabled="true">
<sorting-element type="RESERVED_WORD" id="keyword" />
<sorting-element type="RESERVED_WORD" id="datatype" />
<sorting-element type="OBJECT" id="column" />
<sorting-element type="OBJECT" id="table" />
<sorting-element type="OBJECT" id="view" />
<sorting-element type="OBJECT" id="materialized view" />
<sorting-element type="OBJECT" id="index" />
<sorting-element type="OBJECT" id="constraint" />
<sorting-element type="OBJECT" id="trigger" />
<sorting-element type="OBJECT" id="synonym" />
<sorting-element type="OBJECT" id="sequence" />
<sorting-element type="OBJECT" id="procedure" />
<sorting-element type="OBJECT" id="function" />
<sorting-element type="OBJECT" id="package" />
<sorting-element type="OBJECT" id="type" />
<sorting-element type="OBJECT" id="dimension" />
<sorting-element type="OBJECT" id="cluster" />
<sorting-element type="OBJECT" id="dblink" />
<sorting-element type="OBJECT" id="schema" />
<sorting-element type="OBJECT" id="role" />
<sorting-element type="OBJECT" id="user" />
<sorting-element type="RESERVED_WORD" id="function" />
<sorting-element type="RESERVED_WORD" id="parameter" />
</sorting>
<format>
<enforce-code-style-case value="true" />
</format>
</code-completion-settings>
<execution-engine-settings>
<statement-execution>
<fetch-block-size value="100" />
<execution-timeout value="20" />
<debug-execution-timeout value="600" />
<focus-result value="false" />
<prompt-execution value="false" />
</statement-execution>
<script-execution>
<command-line-interfaces />
<execution-timeout value="300" />
</script-execution>
<method-execution>
<execution-timeout value="30" />
<debug-execution-timeout value="600" />
<parameter-history-size value="10" />
</method-execution>
</execution-engine-settings>
<operation-settings>
<transactions>
<uncommitted-changes>
<on-project-close value="ASK" />
<on-disconnect value="ASK" />
<on-autocommit-toggle value="ASK" />
</uncommitted-changes>
<multiple-uncommitted-changes>
<on-commit value="ASK" />
<on-rollback value="ASK" />
</multiple-uncommitted-changes>
</transactions>
<session-browser>
<disconnect-session value="ASK" />
<kill-session value="ASK" />
<reload-on-filter-change value="false" />
</session-browser>
<compiler>
<compile-type value="KEEP" />
<compile-dependencies value="ASK" />
<always-show-controls value="false" />
</compiler>
<debugger>
<debugger-type value="ASK" />
<use-generic-runners value="true" />
</debugger>
</operation-settings>
<ddl-file-settings>
<extensions>
<mapping file-type-id="VIEW" extensions="vw" />
<mapping file-type-id="TRIGGER" extensions="trg" />
<mapping file-type-id="PROCEDURE" extensions="prc" />
<mapping file-type-id="FUNCTION" extensions="fnc" />
<mapping file-type-id="PACKAGE" extensions="pkg" />
<mapping file-type-id="PACKAGE_SPEC" extensions="pks" />
<mapping file-type-id="PACKAGE_BODY" extensions="pkb" />
<mapping file-type-id="TYPE" extensions="tpe" />
<mapping file-type-id="TYPE_SPEC" extensions="tps" />
<mapping file-type-id="TYPE_BODY" extensions="tpb" />
</extensions>
<general>
<lookup-ddl-files value="true" />
<create-ddl-files value="false" />
<synchronize-ddl-files value="true" />
<use-qualified-names value="false" />
<make-scripts-rerunnable value="true" />
</general>
</ddl-file-settings>
<general-settings>
<regional-settings>
<date-format value="MEDIUM" />
<number-format value="UNGROUPED" />
<locale value="SYSTEM_DEFAULT" />
<use-custom-formats value="false" />
</regional-settings>
<environment>
<environment-types>
<environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" />
<environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" />
<environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" />
<environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" />
</environment-types>
<visibility-settings>
<connection-tabs value="true" />
<dialog-headers value="true" />
<object-editor-tabs value="true" />
<script-editor-tabs value="false" />
<execution-result-tabs value="true" />
</visibility-settings>
</environment>
</general-settings>
</component>
<component name="DBNavigator.Project.StatementExecutionManager">
<execution-variables />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
android{
compileSdkVersion 29
defaultConfig {
applicationId "w.soulofpluto.camera"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes{
release{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies{
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0-beta01'
implementation 'com.google.android.material:material:1.0.0-beta01'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:1.6.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-vision:11.0.2'
implementation 'info.androidhive:barcode-reader:1.1.5'
implementation 'com.google.zxing:core:3.2.1'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'io.reactivex:rxandroid:1.0.1'
implementation 'io.reactivex:rxjava:1.0.14'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
{
"project_info": {
"project_number": "54135562732",
"firebase_url": "https://publishedappsplay.firebaseio.com",
"project_id": "publishedappsplay",
"storage_bucket": "publishedappsplay.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:54135562732:android:dd94de8c2fb5d640",
"android_client_info": {
"package_name": "com.nextinnovation.pt.barcodescanner"
}
},
"oauth_client": [
{
"client_id": "54135562732-lgmk1l24ceq7qi4kicr7in3siee7537m.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.nextinnovation.pt.barcodescanner",
"certificate_hash": "44fe06ab8398f0835871e42ec35418f40a4fbc9e"
}
},
{
"client_id": "54135562732-cjohia0msut8qrisfuh0ta707bulfki2.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCrkEgM5RYDCegLKzrR9N4nfnGoMELbdFw"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "54135562732-cjohia0msut8qrisfuh0ta707bulfki2.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package w.soulofpluto.camera;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("w.soulofpluto.camera", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="w.soulofpluto.camera">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true"
android:largeHeap="true"
android:requestLegacyExternalStorage="true">
<activity
android:name="w.soulofpluto.camera.SplashActivity"
android:screenOrientation="landscape"
android:windowSoftInputMode="stateAlwaysVisible">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="w.soulofpluto.camera.LoginActivity"
android:screenOrientation="landscape"
android:windowSoftInputMode="stateAlwaysVisible">
</activity>
<activity
android:name="w.soulofpluto.camera.MainActivity"
android:screenOrientation="landscape"
android:windowSoftInputMode="stateAlwaysVisible">
</activity>
<activity
android:name=".BarcodeScannerActivity"
android:label="@string/app_name"
android:exported="false"
android:theme="@style/AppOverlayTheme"
android:screenOrientation="landscape">
</activity>
</application>
</manifest>
\ No newline at end of file
package w.soulofpluto.camera;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Handler;
import android.util.Log;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class APICall1 extends AsyncTask<Void, Void, Void> {
private final Context mContext;
private HashMap<String, String> hashMapJson = null;
private HashMap<String, File> hashMapFiles = null;
private HashMap<String, String> hashMap = null;
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
//private final String credential;
//OkHttpClient client = new OkHttpClient();
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(1000, TimeUnit.SECONDS)
.writeTimeout(1000, TimeUnit.SECONDS)
.readTimeout(1000, TimeUnit.SECONDS)
.retryOnConnectionFailure(true)
.build();
private String json;
private String url;
Object object;
private static String result;
private boolean isDialogCancelled;
APIRespose apiRespose;
//private ACProgressFlower dialog;
// basic methos for call back
/**
* @param url
* @param hashMapFiles
* @param hashMapJson
* @param object view context
* @param apiRespose
*/
public APICall1(String url, HashMap<String, File> hashMapFiles, HashMap<String, String> hashMapJson, Object object, APIRespose apiRespose) {
this.url = url;
this.object = object;
this.apiRespose = apiRespose;
mContext = (Context) object;
this.hashMapJson = hashMapJson;
this.hashMapFiles = hashMapFiles;
}
String postMultiPart(String url, HashMap<String, File> hashMapFiles, HashMap<String, String> hashMapJson) throws IOException {
MultipartBody.Builder multiBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM);
// add type entity
for (String key : hashMapJson.keySet()) {
multiBuilder.addFormDataPart(key, hashMapJson.get(key));
}
// add type entity
if (hashMapFiles != null) {
MediaType mediaType = MediaType.parse("image/jpg");
for (String key : hashMapFiles.keySet()) {
if (hashMapFiles.get(key) != null) {
String fileName = hashMapFiles.get(key).getName();
multiBuilder.addFormDataPart("base64OfJpeg", fileName, RequestBody.create(mediaType, hashMapFiles.get(key)));
}
}
}
//Response response = null;
//System.out.println("Data =====>"+multiBuilder.toString());
RequestBody requestBody = multiBuilder.build();
Request request = new Request.Builder()
//.header("Authorization", credential)
.url(url)
.post(requestBody)
.build();
Response response = client.newCall(request).execute();
if(response==null || response.body()== null){
System.out.println("Called =============>");
response = client.newCall(request).execute();
}
return response.body().string();
}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Void doInBackground(Void... voids){
result = "";
//.if multipart
if (hashMapJson != null) {
//Thread.sleep(400);
try{
result = postMultiPart(url, hashMapFiles, hashMapJson);
}catch(IOException e) {
e.printStackTrace();
}
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
System.out.println("Response ====>" + result);
apiRespose.onResponse(result);
super.onPostExecute(aVoid);
}
public interface APIRespose {
void onResponse(String result);
}
}
package w.soulofpluto.camera;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import com.google.android.gms.vision.barcode.Barcode;
import java.util.List;
import info.androidhive.barcode.BarcodeReader;
/*
Create by Ramesh Babu
*/
public class BarcodeFragment extends Fragment implements BarcodeReader.BarcodeReaderListener {
private static final String TAG = BarcodeFragment.class.getSimpleName();
private BarcodeReader barcodeReader;
public BarcodeFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_barcode, container, false);
barcodeReader = (BarcodeReader) getChildFragmentManager().findFragmentById(R.id.barcode_fragment);
barcodeReader.setListener(this);
return view;
}
@Override
public void onScanned(final Barcode barcode) {
Log.e(TAG, "onScanned: " + barcode.displayValue);
barcodeReader.playBeep();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getActivity(), "Barcode: " + barcode.displayValue, Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onScannedMultiple(List<Barcode> barcodes) {
}
@Override
public void onBitmapScanned(SparseArray<Barcode> sparseArray) {
}
@Override
public void onScanError(String errorMessage) {
Log.e(TAG, "onScanError: " + errorMessage);
}
@Override
public void onCameraPermissionDenied() {
Toast.makeText(getActivity(), "Camera permission denied!", Toast.LENGTH_LONG).show();
}
}
package w.soulofpluto.camera;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.vision.barcode.Barcode;
import java.util.List;
import info.androidhive.barcode.BarcodeReader;
/*
Create by Ramesh Babu
*/
public class BarcodeScannerActivity extends AppCompatActivity implements BarcodeReader.BarcodeReaderListener {
private static final String TAG = BarcodeScannerActivity.class.getSimpleName();
private BarcodeReader barcodeReader;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_barcode);
// getting barcode instance
barcodeReader = (BarcodeReader) getSupportFragmentManager().findFragmentById(R.id.barcode_fragment);
/***
* Providing beep sound. The sound file has to be placed in
* `assets` folder
*/
// barcodeReader.setBeepSoundFile("shutter.mp3");
/**
* Pausing / resuming barcode reader. This will be useful when you want to
* do some foreground user interaction while leaving the barcode
* reader in background
* */
// barcodeReader.pauseScanning();
// barcodeReader.resumeScanning();
}
@Override
public void onScanned(final Barcode barcode) {
Log.e(TAG, "onScanned: " + barcode.rawValue);
barcodeReader.playBeep();
//finish();
Intent intent=new Intent();
intent.putExtra("MESSAGE",barcode.displayValue);
setResult(2,intent);
finish();
/*runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(getApplicationContext(), "Barcode: " + barcode.displayValue, Toast.LENGTH_SHORT).show();
}
});*/
}
@Override
public void onScannedMultiple(List<Barcode> barcodes) {
}
@Override
public void onBitmapScanned(SparseArray<Barcode> sparseArray) {
}
@Override
public void onScanError(String errorMessage) {
}
@Override
public void onCameraPermissionDenied() {
Toast.makeText(getApplicationContext(), "Camera permission denied!", Toast.LENGTH_LONG).show();
finish();
}
}
\ No newline at end of file
package w.soulofpluto.camera;
import android.view.MenuItem;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
/*
Create by Ramesh Babu
*/
public class BaseScannerActivity extends AppCompatActivity {
public void setupToolbar(String text) {
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setTitle(text);
final ActionBar ab = getSupportActionBar();
if(ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
}
\ No newline at end of file
package w.soulofpluto.camera;
import android.content.Context;
import android.hardware.Camera;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import java.io.IOException;
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mHolder;
private Camera mCamera;
public CameraPreview(Context context, Camera camera) {
super(context);
mCamera = camera;
mHolder = getHolder();
mHolder.addCallback(this);
// deprecated setting, but required on Android versions prior to 3.0
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
public void surfaceCreated(SurfaceHolder holder) {
try {
// create the surface and start camera preview
if (mCamera == null) {
mCamera.setPreviewDisplay(holder);
mCamera.startPreview();
}
} catch (IOException e) {
Log.d(VIEW_LOG_TAG, "Error setting camera preview: " + e.getMessage());
}
}
public void refreshCamera(Camera camera) {
if (mHolder.getSurface() == null) {
// preview surface does not exist
return;
}
// stop preview before making changes
try {
mCamera.stopPreview();
} catch (Exception e) {
// ignore: tried to stop a non-existent preview
}
// set preview size and make any resize, rotate or
// reformatting changes here
// start preview with new settings
setCamera(camera);
try {
mCamera.setPreviewDisplay(mHolder);
mCamera.startPreview();
} catch (Exception e) {
Log.d(VIEW_LOG_TAG, "Error starting camera preview: " + e.getMessage());
}
}
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
// If your preview can change or rotate, take care of those events here.
// Make sure to stop the preview before resizing or reformatting it.
refreshCamera(mCamera);
}
public void setCamera(Camera camera) {
//method to set a camera instance
mCamera = camera;
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
// TODO Auto-generated method stub
// mCamera.release();
}
}
\ No newline at end of file
package w.soulofpluto.camera;
/*
Create by Ramesh Babu
*/
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Base64;
import android.view.Gravity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
import java.io.ByteArrayOutputStream;
import java.io.File;
public class Constants{
//public static String URL = "https://plutokm.com/save_grc_images_from_mobiles.php";
public static String URL = "https://www.plutokm.com/grc_capture_image2.php?barcode=";
static String base64Image;
public static boolean isNetworkAvailable(Context context){
ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null;
}
public static void getToast(Context context, String data){
Toast toast = Toast.makeText(context, data, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
/*public static String getBase64String(Bitmap bitmap){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] imageBytes = baos.toByteArray();
String base64String = Base64.encodeToString(imageBytes, Base64.NO_WRAP);
return base64String;
}*/
public static String getBase64String(Bitmap bm){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); //bm is the bitmap object
byte[] b = baos.toByteArray();
return Base64.encodeToString(b, Base64.DEFAULT);
}
/* public static String getBase64FromPath(Bitmap bitmap){
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] imageBytes = baos.toByteArray();
String base64String = Base64.encodeToString(imageBytes, Base64.NO_WRAP);
return base64String;
}
*/
public static void hideKeyboard(Activity activity){
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
//Find the currently focused view, so we can grab the correct window token from it.
View view = activity.getCurrentFocus();
//If no view currently has focus, create a new one, just so we can grab a window token from it
if(view == null){
view = new View(activity);
}
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
public static void deleteCache(Context context){
try{
File dir = context.getCacheDir();
deleteDir(dir);
}catch(Exception e){
e.printStackTrace();
}
}
public static boolean deleteDir(File dir){
if (dir != null && dir.isDirectory()){
String[] children = dir.list();
for(int i = 0; i < children.length; i++){
boolean success = deleteDir(new File(dir, children[i]));
if(!success){
return false;
}
}
return dir.delete();
} else if(dir!= null && dir.isFile()) {
return dir.delete();
} else {
return false;
}
}
}
package w.soulofpluto.camera;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
public class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> {
private Context context;
private ArrayList<Model> arrayList;
public CustomAdapter(Context context, ArrayList<Model> list){
this.context = context;
this.arrayList = list;
}
@Override
public CustomAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i){
View View = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.custom_list_item, viewGroup, false);
return new CustomAdapter.ViewHolder(View);
}
public void addItem(int position, Model model) {
arrayList.add(position, model);
notifyItemRangeChanged(position, arrayList.size());
notifyItemInserted(position);
}
public void modifyItem(final int position, final Model model) {
//arrayList.remove(position);
arrayList.set(position, model);
notifyItemChanged(position);
}
@Override
public void onBindViewHolder(CustomAdapter.ViewHolder viewHolder, int i){
final Model model = arrayList.get(i);
viewHolder.item_sku.setText(model.getSKU());
//Bitmap bitmap = BitmapFactory.decodeFile(model.getFILEPATH());
Glide.with(context)
.load(model.getFILEPATH())
//.asBitmap()
//.load(bitmap)
.into(viewHolder.item_image);
//viewHolder.item_no.setText(String.valueOf(model.getID()));
//viewHolder.item_image.setImageBitmap(bitmap);
//System.out.println("Status ==> "+model.getSTATUS());
if(model.getSTATUS() == 0){
viewHolder.item_progress.setText("In Progress");
}else if(model.getSTATUS() ==1){
viewHolder.item_progress.setText("Completed");
}
}
@Override
public int getItemCount(){
return arrayList.size();
}
public void updateAt(int pos, int i) {
Model todoEntity = arrayList.get(pos);
//todoEntity.setText(text);
todoEntity.setSTATUS(i);
notifyItemChanged(pos);
}
public class ViewHolder extends RecyclerView.ViewHolder {
private TextView item_sku,item_progress,item_no;
private ImageView item_image;
public ViewHolder(View itemView){
super(itemView);
item_sku = itemView.findViewById(R.id.item_sku);
item_image = itemView.findViewById(R.id.item_image);
item_progress = itemView.findViewById(R.id.item_progress);
//item_no = itemView.findViewById(R.id.item_no);
}
}
}
package w.soulofpluto.camera;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DataBaseHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 3;
private static final String DATABASE_NAME = "camera.db";
private Context mContext;
private static final String REG_TABLE = " camera";
private static final String _ID = "_id";
private static final String SKU = "sku";
private static final String FILENAME = "filename";
private static final String STATUS = "status";
private static final String CREATE_CAMERA = "CREATE TABLE" + REG_TABLE + "" +
"(" + _ID + " INTEGER PRIMARY KEY AUTOINCREMENT ," + SKU + " TEXT NOT NULL,"
+ FILENAME + " TEXT NOT NULL," + STATUS + " INTEGER" + ")";
public DataBaseHelper(Context context){
super(context, DATABASE_NAME, null, DATABASE_VERSION);
mContext = context;
}
@Override
public void onCreate(SQLiteDatabase db){
db.execSQL(CREATE_CAMERA);
}
@Override
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion){
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS camera");
//db.execSQL("DROP TABLE IF EXISTS quote_table");
onCreate(db);
}
public boolean insertcamera(String sku, String filename, int status){
SQLiteDatabase db = this.getWritableDatabase();
db.beginTransaction();
ContentValues contentValues = new ContentValues();
contentValues.put(SKU, sku);
contentValues.put(FILENAME, filename);
contentValues.put(STATUS, status);
db.insert(REG_TABLE, null, contentValues);
db.setTransactionSuccessful();
db.endTransaction();
db.close();
return true;
}
public Cursor getData(){
SQLiteDatabase db = this.getReadableDatabase();
Cursor res = db.rawQuery( "select * from camera ", null );
Cursor Resultcursor = db.rawQuery("select * from camera " + " ORDER BY " + _ID + " DESC", null);
/*Cursor c = db.query("select * from camera ", null, null, null, null, null, _ID+" DESC");
Cursor Resultcursor = sql.rawQuery("select * from camera ORDER by ID DESC,null);*/
return Resultcursor;
}
public Cursor queryLastEvents(){
SQLiteDatabase db = this.getReadableDatabase();
Cursor res = db.query("camera", null, null, null, null, null, "sku ASC", "10");
return res;
}
public void deleteData(){
/* SQLiteDatabase db = this.getReadableDatabase();
db.delete(REG_TABLE, null, null);
db.close();*/
SQLiteDatabase db = this.getWritableDatabase();
db.delete(REG_TABLE, null, null);
db.close();
}
public boolean updatecamera(int id,String sku, String filename, int status){
SQLiteDatabase db = this.getWritableDatabase();
db.beginTransaction();
ContentValues contentValues = new ContentValues();
contentValues.put(SKU, sku);
contentValues.put(FILENAME, filename);
contentValues.put(STATUS, status);
db.update(REG_TABLE, contentValues, _ID + " = ?", new String[]{"" + id});
System.out.println("update ====>"+ db.update("camera", contentValues, _ID + " = ?", new String[]{"" + id}));
db.setTransactionSuccessful();
db.endTransaction();
db.close();
return true;
}
public boolean deleteContact(int id){
SQLiteDatabase db = this.getReadableDatabase();
db.beginTransaction();
db.delete(REG_TABLE, _ID + " = ?", new String[] { String.valueOf(id)});
System.out.println("Delete ===>"+db.delete(REG_TABLE, _ID + " = ?", new String[] { String.valueOf(id)}));
db.setTransactionSuccessful();
db.endTransaction();
db.close();
return true;
}
public int gettotalCount(){
int _id = 0;
SQLiteDatabase db = this.getReadableDatabase();
//Cursor Resultcursor = db.rawQuery("select _id from camera " + " ORDER BY " + _ID + " DESC", "where limit 1");
//below one index based query
Cursor cr = db.rawQuery("select _id from camera ORDER BY "+ _ID +" DESC LIMIT 1",null);
if(cr.moveToLast()){
_id = cr.getInt(0);
}
/*long count = DatabaseUtils.queryNumEntries(db, REG_TABLE);*/
db.close();
return _id;
}
}
package w.soulofpluto.camera;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
/*
Create by Ramesh Babu
*/
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
EditText user,pass;
Button login;
PreferenceManager preferenceManager;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.activity_login);
user = findViewById(R.id.user);
pass = findViewById(R.id.pass);
login= findViewById(R.id.login);
login.setOnClickListener(this);
preferenceManager = new PreferenceManager(this);
super.onCreate(savedInstanceState);
}
@Override
public void onClick(View view){
if(view == login){
if(TextUtils.isEmpty(user.getText().toString()) && TextUtils.isEmpty(pass.getText().toString())){
Toast.makeText(LoginActivity.this, "Enter User,Password", Toast.LENGTH_SHORT).show();
}else if(TextUtils.isEmpty(user.getText().toString())){
Toast.makeText(LoginActivity.this, "Enter User", Toast.LENGTH_SHORT).show();
}else if(TextUtils.isEmpty(pass.getText().toString())){
Toast.makeText(LoginActivity.this, "Enter Password", Toast.LENGTH_SHORT).show();
}else if (user.getText().toString().equalsIgnoreCase("user") && pass.getText().toString().equalsIgnoreCase("123")){
preferenceManager.setUserId(user.getText().toString());
preferenceManager.setPassword(pass.getText().toString());
preferenceManager.setLogged(true);
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
intent.putExtra("key","success");
startActivity(intent);
finish();
}else{
Toast.makeText(LoginActivity.this, "Enter Valid User,Password", Toast.LENGTH_SHORT).show();
}
}
}
}
package w.soulofpluto.camera;
import android.Manifest;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.hardware.Camera;
import android.os.Build;
import android.os.Environment;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Pattern;
import static w.soulofpluto.camera.Constants.deleteCache;
import static w.soulofpluto.camera.Constants.hideKeyboard;
import static w.soulofpluto.camera.Model.OrderbyID;
public class MainActivity extends AppCompatActivity implements View.OnFocusChangeListener {
private static final int STORAGE_PERMISSION_REQUEST_CODE = 1 ;
private DataBaseHelper dataBaseHelper;
private HashMap<String, File> filesHashMap = new HashMap<>();
private RecyclerView list;
private EditText autotext;
private FrameLayout image_layout;
private Camera mCamera;
private CameraPreview mPreview;
private String BarcodeValue;
private ArrayList<Model> arrayList;
private CustomAdapter customAdapter;
int ALL_PERMISSIONS = 101;
private boolean safeToTakePicture = false;
private int RequestCode = 2;
private Boolean connect = false;
public Menu globalMenuItem;
private String ScannerData ="";
PreferenceManager preferenceManager;
private int Total = 0;
@RequiresApi(api = Build.VERSION_CODES.N)
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
list = findViewById(R.id.list);
autotext = findViewById(R.id.autotext);
//RDSTJENS00021178 = findViewById(R.id.RDSTJENS00021178);
dataBaseHelper = new DataBaseHelper(this);
autotext.addTextChangedListener(new AutoChecked());
arrayList = new ArrayList<>();
/*RDSTJENS00021178.addTextChangedListener(new AutoChecked());*/
//autotext.requestFocus();
System.out.println("Database ====>"+dataBaseHelper.gettotalCount());
if(dataBaseHelper.gettotalCount()>0)
updateDatabaseValues();
runtimepermission();
hideKeyboard(MainActivity.this);
preferenceManager = new PreferenceManager(this);
if(getIntent().getStringExtra("key") != null){
if(getIntent().getStringExtra("key").equalsIgnoreCase("success")){
if(preferenceManager.getID().length() > 0){
if(preferenceManager.getID().equalsIgnoreCase(String.valueOf(dataBaseHelper.gettotalCount()))){
Total = Integer.parseInt(preferenceManager.getID());
}else if(Integer.parseInt(preferenceManager.getID()) > dataBaseHelper.gettotalCount()){
Total = Integer.parseInt(preferenceManager.getID());
}else{
Total = dataBaseHelper.gettotalCount();
}
}else{
Total = dataBaseHelper.gettotalCount();
}
System.out.println("DataSize if ===>" + Total);
}
}else{
Total = dataBaseHelper.gettotalCount();
System.out.println("DataSize else ===>"+Total);
}
try {
customAdapter = new CustomAdapter(this, arrayList);
list.setLayoutManager(new LinearLayoutManager(MainActivity.this));
list.setAdapter(customAdapter);
}catch (NullPointerException np){
np.printStackTrace();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu){
getMenuInflater().inflate(R.menu.menu, menu);
globalMenuItem = menu;
globalMenuItem.findItem(R.id.menu_take_picture).setVisible(false);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item){
switch (item.getItemId()){
case R.id.menu_scan:
if(Constants.isNetworkAvailable(MainActivity.this)) {
IntentIntegrator intentIntegrator = new IntentIntegrator(MainActivity.this);
ArrayList<String> data = new ArrayList<>();
data.add("CODE_128");
intentIntegrator.setDesiredBarcodeFormats(data);
intentIntegrator.setBeepEnabled(true);
intentIntegrator.setCameraId(0);
intentIntegrator.setPrompt("SCAN");
intentIntegrator.setBarcodeImageEnabled(false);
intentIntegrator.initiateScan();
}else{
Constants.getToast(MainActivity.this,"Please check your internet connection");
}
//startScanningBarcode();
break;
case R.id.menu_take_picture:
if(safeToTakePicture) {
safeToTakePicture = false;
mCamera.takePicture(null, null, mPicture);
}
break;
case R.id.menu_logout:
if(dataBaseHelper.gettotalCount()>0) {
Cursor c = dataBaseHelper.getData();
if (c != null && c.moveToFirst()) {
do {
if (c.getInt(c.getColumnIndex("status")) == 0) {
final Model model = new Model();
model.setID(c.getInt(c.getColumnIndex("_id")));
model.setSKU(c.getString(c.getColumnIndex("sku")));
model.setFILEPATH(c.getString(c.getColumnIndex("filename")));
model.setSTATUS(c.getInt(c.getColumnIndex("status")));
final int finalId = c.getInt(c.getColumnIndex("_id"));
final String finalsku = c.getString(c.getColumnIndex("sku"));
final String finalfilename = c.getString(c.getColumnIndex("filename"));
try {
Handler handler = new Handler();
handler.postDelayed(
new Runnable() {
public void run() {
if (Constants.isNetworkAvailable(MainActivity.this)){
NetworkCall(finalId,finalsku, finalfilename, model);
} else {
Constants.getToast(MainActivity.this, "Check your internet connection");
}
}
}, 500);
}catch (ArrayIndexOutOfBoundsException ae){
ae.printStackTrace();
}
}//arrayList.add(model);
} while (c.moveToNext());
}
}
preferenceManager.setLogged(false);
preferenceManager.setUserId("");
preferenceManager.setPassword("");
preferenceManager.setID(String.valueOf(dataBaseHelper.gettotalCount()));
dataBaseHelper.deleteData();
if(dataBaseHelper.gettotalCount() == 0){
System.out.println("Check if ===>"+preferenceManager.getID());
}else{
System.out.println("Check else===>"+preferenceManager.getID());
preferenceManager.setID(String.valueOf(dataBaseHelper.gettotalCount()));
}
//MyApplication.getInstance().clearApplicationData();
deleteCache(MainActivity.this);
try{
mCamera.release();
image_layout.removeAllViews();
Intent in = new Intent(this,LoginActivity.class);
startActivity(in);
finish();
}catch(RuntimeException re){
re.printStackTrace();
}
break;
}
return super.onOptionsItemSelected(item);
}
private Boolean name(String data){
Pattern regex = Pattern.compile("[$~&+,:;=\\\\?@#|/'<>^*()%!-]");
if(regex.matcher(data).find()){
return true;
}
return false;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data){
IntentResult Result = IntentIntegrator.parseActivityResult(requestCode , resultCode ,data);
if(Result != null){
if(Result.getContents() == null){
Log.i("MainActivity" , "cancelled scan");
//Toast.makeText(this, "cancelled", Toast.LENGTH_SHORT).show();
}
else {
Log.i("MainActivity" , "Scanned");
//Toast.makeText(this,"Scanned -> " + Result.getContents(), Toast.LENGTH_SHORT).show();
ScannerData = Result.getContents();
if(name(ScannerData)) {
if(Constants.isNetworkAvailable(MainActivity.this)) {
/* Intent intent=new Intent(MainActivity.this,BarcodeScannerActivity.class);
startActivityForResult(intent, RequestCode);*/
IntentIntegrator intentIntegrator = new IntentIntegrator(MainActivity.this);
ArrayList<String> data1 = new ArrayList<>();
data1.add("CODE_128");
intentIntegrator.setDesiredBarcodeFormats(data1);
intentIntegrator.setBeepEnabled(true);
intentIntegrator.setCameraId(0);
intentIntegrator.setPrompt("SCAN");
intentIntegrator.setBarcodeImageEnabled(false);
intentIntegrator.initiateScan();
}else{
Constants.getToast(MainActivity.this,"Please check your internet connection");
}
//System.out.println("Scanner if====>" +Result.getContents());
//Constants.getToast(MainActivity.this,"Scanner if"+Result.getContents());
}else{
System.out.println("Scanner else====>" +Result.getContents());
//Constants.getToast(MainActivity.this,"Scanner else"+Result.getContents());
globalMenuItem.findItem(R.id.menu_scan).setVisible(false);
globalMenuItem.findItem(R.id.menu_take_picture).setVisible(true);
connect = true;
}
}
}
else {
super.onActivityResult(requestCode , resultCode , data);
}
/*if(resultCode != RESULT_CANCELED){
if(requestCode == RequestCode){
System.out.println("Scanner ====>" +data.getStringExtra("MESSAGE"));
ScannerData = data.getStringExtra("MESSAGE");
if(name(ScannerData)) {
if(Constants.isNetworkAvailable(MainActivity.this)){
Intent intent=new Intent(MainActivity.this,BarcodeScannerActivity.class);
startActivityForResult(intent, RequestCode);
}else{
Constants.getToast(MainActivity.this,"Please check your internet connection");
}
System.out.println("Scanner if====>" +data.getStringExtra("MESSAGE"));
}else{
System.out.println("Scanner else====>" +data.getStringExtra("MESSAGE"));
globalMenuItem.findItem(R.id.menu_scan).setVisible(false);
globalMenuItem.findItem(R.id.menu_take_picture).setVisible(true);
connect = true;
}
}
}*/
super.onActivityResult(requestCode, resultCode, data);
}
private void runtimepermission(){
if(ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED){
final String[] permissions = new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE};
ActivityCompat.requestPermissions(this, permissions, ALL_PERMISSIONS);
}else{
take_priview();
}
if(!Constants.isNetworkAvailable(this)){
Constants.getToast(this, "check internet connection");
}else{
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
STORAGE_PERMISSION_REQUEST_CODE);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults){
switch(requestCode){
case 101:
boolean isPerpermissionForAllGranted = false;
if(grantResults.length > 0 && permissions.length==grantResults.length){
for(int i = 0; i < permissions.length; i++){
if(grantResults[i] == PackageManager.PERMISSION_GRANTED){
isPerpermissionForAllGranted=true;
take_priview();
}else{
isPerpermissionForAllGranted=false;
}
}
}else{
isPerpermissionForAllGranted=true;
}
if(isPerpermissionForAllGranted){
}
break;
default:
break;
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
public void onFocusChange(View view, boolean b) {
autotext.requestFocus();
}
class AutoChecked implements TextWatcher{
public void afterTextChanged(Editable s){
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
public void onTextChanged(CharSequence s, int start, int before, int count){
try{
if(s.toString().length() > 4){
BarcodeValue = s.toString();
System.out.println("Barcode ===>"+BarcodeValue);
if (s.toString().toLowerCase().contains("capture")){
if(safeToTakePicture) {
if(Constants.isNetworkAvailable(MainActivity.this)){
safeToTakePicture = false;
connect = false;
mCamera.takePicture(null, null, mPicture);
}else{
Constants.getToast(MainActivity.this,"Please check your internet connection");
}
}
}else if (s.toString().toLowerCase().contains("@apture")){
autotext.setText("");
autotext.requestFocus();
}else if (s.toString().toLowerCase().contains("@lpture")){
autotext.setText("");
autotext.requestFocus();
}
}
}catch(NumberFormatException nfe){
nfe.printStackTrace();
}
}
}
@Override
protected void onResume() {
if(mCamera !=null) {
//mCamera.startPreview();
release();
}
super.onResume();
}
private void take_priview(){
mCamera = getCameraInstance();
mPreview = new CameraPreview(this, mCamera);
image_layout = findViewById(R.id.image_layout);
image_layout.addView(mPreview);
}
private Camera getCameraInstance(){
Camera camera = null;
try {
camera = Camera.open();
Camera.Parameters params = camera.getParameters();
List<Camera.Size> allSizes = params.getSupportedPictureSizes();
Camera.Size size = allSizes.get(0);
for (int i = 0; i < allSizes.size(); i++) {
if (allSizes.get(i).width > size.width)
size = allSizes.get(i);
}
params.setPictureSize(size.width,size.height);
params.setJpegQuality(50);
if(params!=null) {
camera.setParameters(params);
}
camera.startPreview();
safeToTakePicture = true;
} catch (Exception e) {
}
return camera;
}
Camera.PictureCallback mPicture = new Camera.PictureCallback(){
@Override
public void onPictureTaken(byte[] data, Camera camera){
try{
File mediaFile = getOutputMediaFile();
/* View v1 =MainActivity.this.getWindow().getDecorView().getRootView();
v1.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
File imageFile = new File(String.valueOf(mediaFile));
FileOutputStream outputStream = new FileOutputStream(imageFile);
int quality = 30;
bitmap.compress(Bitmap.CompressFormat.JPEG, quality, outputStream);
try {
outputStream.flush();
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}*/
if(mediaFile == null){
camera.startPreview();
safeToTakePicture = true;
globalMenuItem.findItem(R.id.menu_scan).setVisible(true);
globalMenuItem.findItem(R.id.menu_take_picture).setVisible(false);
return;
}else{
globalMenuItem.findItem(R.id.menu_scan).setVisible(true);
globalMenuItem.findItem(R.id.menu_take_picture).setVisible(false);
}
FileOutputStream fos = null;
try{
fos = new FileOutputStream(mediaFile);
fos.write(data);
}catch(FileNotFoundException e){
}catch(IOException e){
}finally{
try{
fos.close();
}catch(IOException e){
e.printStackTrace();
}
}
release();
data(mediaFile);
}catch(NullPointerException np){
np.printStackTrace();
}
}
};
private void data(final File mediaFile){
if(connect) {
//arrayList = new ArrayList<>();
int id = 0;
if (Total == 0){
if(ScannerData.length() > 0) {
if(ScannerData.toLowerCase().contains("capture")){
Constants.getToast(MainActivity.this,"ReScan it again");
}else{
id = (int) Total + 1;
System.out.println("Id if ====>" + id);
final Model model = new Model();
model.setID(id);
model.setSKU(ScannerData);
model.setFILEPATH(mediaFile.toString());
model.setSTATUS(0);
arrayList.add(0, model);
//arrayList.add(model);
customAdapter = new CustomAdapter(this, arrayList);
list.setLayoutManager(new LinearLayoutManager(MainActivity.this));
list.setAdapter(customAdapter);
customAdapter.notifyDataSetChanged();
Handler handler = new Handler();
final int finalId = id;
handler.postDelayed(new Runnable() {
public void run() {
if (Constants.isNetworkAvailable(MainActivity.this)) {
dataBaseHelper.insertcamera(ScannerData, mediaFile.toString(), 0);
NetworkCall(finalId, ScannerData, mediaFile.toString(), model);
Total = dataBaseHelper.gettotalCount();
System.out.println("Total if ===>" + Total);
} else {
Constants.getToast(MainActivity.this, "Check your internet connection");
}
}
}, 100);
autotext.setText("");
autotext.clearFocus();
autotext.requestFocus();
autotext.setCursorVisible(true);
autotext.setFocusable(true);
}
}
} else {
if (ScannerData.length() > 0) {
if(ScannerData.toLowerCase().contains("capture")) {
Constants.getToast(MainActivity.this,"ReScan it again");
}else{
id = (int) Total + 1;
final Model model = new Model();
model.setID(id);
model.setSKU(ScannerData);
model.setFILEPATH(mediaFile.toString());
model.setSTATUS(0);
System.out.println("Id else ====>"+id);
System.out.println("Id else ====>"+ScannerData);
System.out.println("Id else ====>"+mediaFile.toString());
arrayList.add(0, model);
//arrayList.add(model);
customAdapter.notifyDataSetChanged();
Handler handler = new Handler();
final int finalId = id;
handler.postDelayed(
new Runnable() {
public void run() {
if(Constants.isNetworkAvailable(MainActivity.this)) {
dataBaseHelper.insertcamera(ScannerData, mediaFile.toString(), 0);
NetworkCall(finalId, ScannerData, mediaFile.toString(), model);
Total = dataBaseHelper.gettotalCount();
System.out.println("Total else ===>"+Total);
}else{
Constants.getToast(MainActivity.this,"Check your internet connection");
}
}
}, 100);
autotext.setText("");
autotext.requestFocus();
}
}
}
}
else {
int id = 0;
if (Total == 0){
final String BarcodeValue1[] = BarcodeValue.split("Capture");
System.out.println("Sku ===>"+BarcodeValue.toLowerCase());
System.out.println("Sku ===>"+BarcodeValue1[0]);
System.out.println("Sku ===>"+autotext.getText().toString());
if (BarcodeValue1[0].length() > 0){
System.out.println("Sku ===>"+BarcodeValue.toLowerCase());
System.out.println("Sku ===>"+BarcodeValue1[0]);
arrayList = new ArrayList<>();
id = (int) Total + 1;
final Model model = new Model();
model.setID(id);
model.setSKU(BarcodeValue1[0]);
model.setFILEPATH(mediaFile.toString());
model.setSTATUS(0);
arrayList.add(0, model);
//arrayList.add(model);
customAdapter = new CustomAdapter(this, arrayList);
list.setLayoutManager(new LinearLayoutManager(MainActivity.this));
list.setAdapter(customAdapter);
customAdapter.notifyDataSetChanged();
Handler handler = new Handler();
final int finalId = id;
handler.postDelayed(
new Runnable(){
public void run(){
if(Constants.isNetworkAvailable(MainActivity.this)) {
dataBaseHelper.insertcamera(BarcodeValue1[0].trim(), mediaFile.toString(), 0);
Total = dataBaseHelper.gettotalCount();
NetworkCall(finalId, BarcodeValue1[0].trim(), mediaFile.toString(), model);
}else{
Constants.getToast(MainActivity.this,"Check your internet connection");
}
}
}, 500);
autotext.setText("");
autotext.clearFocus();
autotext.requestFocus();
autotext.setCursorVisible(true);
autotext.setFocusable(true);
} else {
autotext.setText("");
autotext.clearFocus();
autotext.requestFocus();
autotext.setCursorVisible(true);
autotext.setFocusable(true);
}
} else {
System.out.println("count ====>"+dataBaseHelper.gettotalCount());
final String BarcodeValue1[] = BarcodeValue.split("Capture");
if (BarcodeValue1[0].length() > 0) {
System.out.println("Sku ===>"+BarcodeValue.toLowerCase());
System.out.println("Sku ===>"+BarcodeValue1[0]);
id = (int) Total + 1;
final Model model = new Model();
model.setID(id);
model.setSKU(BarcodeValue1[0]);
model.setFILEPATH(mediaFile.toString());
model.setSTATUS(0);
arrayList.add(0, model);
//arrayList.add(model);
customAdapter.notifyDataSetChanged();
Handler handler = new Handler();
final int finalId = id;
handler.postDelayed(
new Runnable() {
public void run() {
if(Constants.isNetworkAvailable(MainActivity.this)) {
dataBaseHelper.insertcamera(BarcodeValue1[0].trim(), mediaFile.toString(), 0);
NetworkCall(finalId, BarcodeValue1[0].trim(), mediaFile.toString(), model);
Total = dataBaseHelper.gettotalCount();
}else{
Constants.getToast(MainActivity.this,"Check your internet connection");
}
}
}, 500);
autotext.setText("");
autotext.requestFocus();
} else {
autotext.setText("");
autotext.requestFocus();
}
}
}
}
private File getOutputMediaFile(){
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
"MyCameraApp");
if (!mediaStorageDir.exists()){
if (!mediaStorageDir.mkdirs()){
Log.d("MyCameraApp", "failed to create directory");
return null;
}
}
// Create a media file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
File mediaFile;
mediaFile = new File(mediaStorageDir.getPath() + File.separator + "RAM_" + timeStamp + ".jpg");
System.out.println("MEDIA FILE ====>"+mediaFile);
System.out.println("MEDIA FILE ====>"+autotext.getText().toString());
return mediaFile;
}
class MyThread implements Runnable{
@Override
public void run(){
Cursor c = dataBaseHelper.getData();
if(c != null){
if(c.moveToFirst()){
do{
if(c.getInt(c.getColumnIndex("status")) == 0){
Model model = new Model();
model.setID(c.getInt(c.getColumnIndex("_id")));
model.setSKU(c.getString(c.getColumnIndex("sku")));
model.setFILEPATH(c.getString(c.getColumnIndex("filename")));
model.setSTATUS(c.getInt(c.getColumnIndex("status")));
NetworkCall(c.getInt(c.getColumnIndex("_id")), c.getString(c.getColumnIndex("sku")), c.getString(c.getColumnIndex("filename")), model);
}//arrayList.add(model);
}while(c.moveToNext());
}
}
}
}
private void release(){
mCamera.release();
image_layout.removeAllViews();
take_priview();
}
public void updateDatabaseValues(){
arrayList = new ArrayList<>();
Cursor c = dataBaseHelper.getData();
if(c != null){
if(c.moveToFirst()){
do{
System.out.println("Index value ===>"+c.getInt(c.getColumnIndex("_id")));
Model model = new Model();
model.setID(c.getInt(c.getColumnIndex("_id")));
model.setSKU(c.getString(c.getColumnIndex("sku")));
model.setFILEPATH(c.getString(c.getColumnIndex("filename")));
model.setSTATUS(c.getInt(c.getColumnIndex("status")));
System.out.println("Status ====>"+c.getString(c.getColumnIndex("status")));
arrayList.add(model);
}while(c.moveToNext());
}
}
customAdapter = new CustomAdapter(this,arrayList);
list.setLayoutManager(new LinearLayoutManager(MainActivity.this));
list.setAdapter(customAdapter);
}
public void NetworkCall(final int id,final String autotext, final String storage,final Model mo){
if(filesHashMap != null && filesHashMap.size() > 0){
filesHashMap.clear();
}
//filesHashMap.put("" + System.currentTimeMillis(), new File(storage));
HashMap<String, String> map = new HashMap<>();
//map.put("barcode", autotext);
map.put("base64OfJpeg",storage);
map.put("uploadedBy", "GRCAPP");
filesHashMap.put("" + System.currentTimeMillis(), new File(storage));
new APICall1(Constants.URL + autotext, filesHashMap , map , this, new APICall1.APIRespose(){
@Override
public void onResponse(String result){
if(result != null && !result.isEmpty()){
System.out.println("Merchant Data =====>" + result);
System.out.println("Merchant Data =====>" + id);
try{
JSONObject object = new JSONObject(result);
if(object.has("success")){
if(object.getString("message").equalsIgnoreCase("Success: Image Saved")){
try{
System.out.println("success Id "+id);
if(dataBaseHelper.gettotalCount() > 0 ){
dataBaseHelper.updatecamera(id,autotext, storage, 1);
arrayList.remove(mo);
/* dataBaseHelper.deleteContact(id);
customAdapter.notifyDataSetChanged();*/
Model model = new Model();
model.setID(id);
model.setSKU(autotext);
model.setFILEPATH(storage);
model.setSTATUS(1);
arrayList.add(model);
Collections.sort(arrayList, OrderbyID);
customAdapter.notifyDataSetChanged();
}
}catch(NullPointerException np){
np.printStackTrace();
}
}
}
}catch(JSONException e) {
e.printStackTrace();
}
}else{
Handler handler = new Handler();
handler.postDelayed(
new Runnable() {
public void run(){
if(Constants.isNetworkAvailable(MainActivity.this)) {
NetworkCall(id, autotext, storage, mo);
}else{
Constants.getToast(MainActivity.this,"Check your internet connection");
}
}
}, 500);
Constants.getToast(MainActivity.this,"Else Case ");
}
}
}).execute();
}
}
package w.soulofpluto.camera;
import java.util.Comparator;
/*
Create by Ramesh Babu
*/
public class Model{
private int ID;
private String SKU;
private String FILEPATH;
private int STATUS;
public int getID() {
return ID;
}
public void setID(int ID) {
this.ID = ID;
}
public String getSKU() {
return SKU;
}
public void setSKU(String SKU) {
this.SKU = SKU;
}
public String getFILEPATH() {
return FILEPATH;
}
public void setFILEPATH(String FILEPATH) {
this.FILEPATH = FILEPATH;
}
/*public int getSTATUS() {
return STATUS;
}
public void setSTATUS(int status) {
this.ID = ID;
}*/
public int getSTATUS() {
return STATUS;
}
public void setSTATUS(int STATUS) {
this.STATUS = STATUS;
}
public static Comparator<Model> OrderbyID = new Comparator<Model>(){
public int compare(Model s2, Model s1){
int S1 = s2.getID();
int S2 = s1.getID();
return S2 - S1;
}
};
}
package w.soulofpluto.camera;
import android.app.Application;
import android.util.Log;
import java.io.File;
/*
Create by Ramesh Babu
*/
public class MyApplication extends Application {
private static MyApplication instance;
@Override
public void onCreate() {
super.onCreate();
instance = this;
}
public static MyApplication getInstance() {
return instance;
}
public void clearApplicationData() {
File cache = getCacheDir();
File appDir = new File(cache.getParent());
if (appDir.exists()) {
String[] children = appDir.list();
for (String s : children) {
if (!s.equals("lib")) {
deleteDir(new File(appDir, s));
Log.i("TAG", "File /data/data/APP_PACKAGE/" + s + " DELETED");
}
}
}
}
public static boolean deleteDir(File dir) {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
}
return dir.delete();
}
}
\ No newline at end of file
package w.soulofpluto.camera;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
/*
Create by Ramesh Babu
*/
public class PreferenceManager{
public static final String KEY_USER_ID = "user_id";
public static final String KEY_PASSWORD = "password";
public static final String KEY_EMAIL = "email";
public static final String CUST_TOKEN = "CUSTOMER_TOKEN";
public static final String STORE_ID = "store_id";
public static final String FIRST_NAME = "first_name";
public static final String LAST_NAME = "last_name";
public static final String MODULE = "Module";
public static final String PREFIX = "ds_prefix";
public static final String KEY_LOGGED = "is_logged";
public static final String ID = "ID";
public static final String BLUETOOTH = "bluetooth";
public static final String STORENAME = "storeName";
public static final String APP_SHARED_PREFS = PreferenceManager.class.getSimpleName();
public static SharedPreferences _sharedPrefs;
public static SharedPreferences.Editor _prefsEditor;
@SuppressWarnings("static-access")
public PreferenceManager(Context context){
_sharedPrefs = context.getSharedPreferences(APP_SHARED_PREFS, Activity.MODE_PRIVATE);
_prefsEditor = _sharedPrefs.edit();
}
public static PreferenceManager getInstance(){
return (PreferenceManager) _sharedPrefs;
}
public void delete(){
_prefsEditor.remove(KEY_USER_ID);
_prefsEditor.apply();
}
public void setFirstName(String firstName){
_prefsEditor.putString(FIRST_NAME,firstName);
_prefsEditor.apply();
}
public String getFirstName(){
return _sharedPrefs.getString(FIRST_NAME,"");
}
public void setModule(String Mod){
_prefsEditor.putString(MODULE,Mod);
_prefsEditor.apply();
}
public String getModule(){
return _sharedPrefs.getString(MODULE,"");
}
public void setBLUETOOTH(String Mod){
_prefsEditor.putString(BLUETOOTH,Mod);
_prefsEditor.apply();
}
public String getBLUETOOTH(){
return _sharedPrefs.getString(BLUETOOTH,"");
}
public void setLastName(String lastName){
_prefsEditor.putString(LAST_NAME,lastName);
_prefsEditor.apply();
}
public String getLastName(){
return _sharedPrefs.getString(LAST_NAME,"");
}
public void setStoreId(String quoteId){
_prefsEditor.putString(STORE_ID,quoteId);
_prefsEditor.apply();
}
public String getStoreId(){
return _sharedPrefs.getString(STORE_ID,"");
}
public void setPrefix(String prefix){
_prefsEditor.putString(PREFIX,prefix);
_prefsEditor.apply();
}
public String getPrefix(){
return _sharedPrefs.getString(PREFIX,"");
}
public void setCustToken(String token){
_prefsEditor.putString(CUST_TOKEN,token);
_prefsEditor.apply();
}
public String getCustToken(){
return _sharedPrefs.getString(CUST_TOKEN,"");
}
public void setID(String id){
_prefsEditor.putString(ID, id);
_prefsEditor.apply();
}
public String getID(){
return _sharedPrefs.getString(ID, "");
}
public void setEmail(String email){
_prefsEditor.putString(KEY_EMAIL, email);
_prefsEditor.apply();
}
public String getEmail(){
return _sharedPrefs.getString(KEY_EMAIL, "");
}
public void setPassword(String pass){
_prefsEditor.putString(KEY_PASSWORD, pass);
_prefsEditor.apply();
}
public String getPassword(){
return _sharedPrefs.getString(KEY_PASSWORD, "");
}
public void setStoreName(String storename){
_prefsEditor.putString(STORENAME, storename);
_prefsEditor.apply();
}
public String getStoreName(){
return _sharedPrefs.getString(STORENAME, "");
}
public void setUserId(String userId){
_prefsEditor.putString(KEY_USER_ID, userId);
_prefsEditor.apply();
}
public String getUserId(){
return _sharedPrefs.getString(KEY_USER_ID, "");
}
public void setLogged(boolean key){
_prefsEditor.putBoolean(KEY_LOGGED, key);
_prefsEditor.apply();
}
public boolean isLogged(){
return _sharedPrefs.getBoolean(KEY_LOGGED, false);
}
}
package w.soulofpluto.camera;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
/*
Create by Ramesh Babu
*/
public class SplashActivity extends AppCompatActivity{
PreferenceManager preferenceManager;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState){
setContentView(R.layout.activity_splash);
preferenceManager = new PreferenceManager(this);
splashMethod();
super.onCreate(savedInstanceState);
}
public void splashMethod(){
Handler handler = new Handler();
Runnable runnable = new Runnable(){
@Override
public void run(){
// TODO Auto-generated method stub
/*startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();*/
if(preferenceManager.isLogged()){
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
}else{
startActivity(new Intent(SplashActivity.this, LoginActivity.class));
finish();
}
}
};
handler.postDelayed(runnable, 2500);
}
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<!-- Barcode Reader fragment -->
<fragment
android:id="@+id/barcode_fragment"
android:name="info.androidhive.barcode.BarcodeReader"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:auto_focus="true"
app:use_flash="false" />
<!-- Scanner overlay animation -->
<info.androidhive.barcode.ScannerOverlay
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#44000000"
app:line_color="#7323DC"
app:line_speed="6"
app:line_width="4"
app:square_height="500"
app:square_width="650" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layout_margin="20dp">
<EditText
android:id="@+id/user"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="user"
android:singleLine="true"/>
<EditText
android:id="@+id/pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="123"
android:singleLine="true"/>
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Login"
android:textColor="@android:color/white"
android:background="@color/colorPrimary"
android:minHeight="40dp"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="1"
android:layout_margin="5dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:id="@+id/image_layout">
</FrameLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:orientation="vertical">
<EditText
android:id="@+id/autotext"
android:layout_width="match_parent"
android:layout_height="55dp"
android:hint="SKU"
android:maxLines="2"/>
<!--
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1"
>
<EditText
android:id="@+id/autotext"
android:layout_width="0dp"
android:layout_height="50dp"
android:hint="SKU"
android:maxLines="2"
android:layout_weight="0.5">
</EditText>
<EditText
android:id="@+id/capture"
android:layout_width="0dp"
android:layout_height="50dp"
android:hint="Capture"
android:maxLines="2"
android:layout_weight="0.5">
</EditText>
</LinearLayout>-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_gravity="top"
android:minHeight="?attr/actionBarSize"
android:background="@color/actionbar_opacity"
app:theme="@style/TransparentToolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:layout_margin="5dp"
android:gravity="center">
<TextView
android:id="@+id/item_sku"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.30"
android:textColor="@android:color/black"
android:text="Sku"/>
<ImageView
android:id="@+id/item_image"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="0.30"
android:src="@mipmap/ic_launcher"/>
<TextView
android:id="@+id/item_progress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:textColor="@android:color/black"
android:text="In Progress"/>
<!-- <TextView
android:id="@+id/item_no"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1"
android:textColor="@android:color/black"
android:text="cout"/>-->
</LinearLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Barcode Reader fragment -->
<fragment
android:id="@+id/barcode_fragment"
android:name="info.androidhive.barcode.BarcodeReader"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:auto_focus="true"
app:use_flash="false" />
<!-- Scanner overlay animation -->
<info.androidhive.barcode.ScannerOverlay
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#44000000"
app:line_color="#7323DC"
app:line_speed="6"
app:line_width="4"
app:square_height="200"
app:square_width="200" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_scan"
android:icon="@drawable/scan"
android:title="Delete"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/menu_take_picture"
android:title="Take Picture"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/menu_logout"
android:icon="@drawable/ic_logout_24"
android:title="Logout"
app:showAsAction="ifRoom"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="primary">#3F51B5</color>
<color name="primary_dark">#303F9F</color>
<color name="primary_light">#C5CAE9</color>
<color name="accent">#E040FB</color>
<color name="primary_text">#212121</color>
<color name="secondary_text">#727272</color>
<color name="actionbar_opacity">#33000000</color>
</resources>
<resources>
<string name="app_name">Camera</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="TransparentToolbar" parent="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:windowActionBarOverlay">true</item>
<!-- Support Library compability -->
<item name="windowActionBarOverlay">true</item>
</style>
<style name="AppOverlayTheme" parent="@style/Theme.AppCompat.Light">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="colorPrimary">@color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="colorPrimaryDark">@color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields e.g. FloatActionButton -->
<item name="colorAccent">@color/accent</item>
<!-- Title Text Color -->
<item name="android:textColorPrimary">@color/primary_text</item>
<!-- color of the menu overflow icon (three vertical dots) -->
<item name="android:textColorSecondary">@color/secondary_text</item>
</style>
</resources>
package w.soulofpluto.camera;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
#Mon Dec 30 10:51:02 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
include ':app'
rootProject.name='Camera'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment