|
|
|
@@ -38,6 +38,7 @@ import androidx.core.app.ActivityCompat;
|
|
|
|
|
import androidx.core.content.ContextCompat;
|
|
|
|
|
import androidx.core.content.FileProvider;
|
|
|
|
|
|
|
|
|
|
import com.google.android.gms.appindexing.Action;
|
|
|
|
|
import com.google.android.gms.appindexing.AppIndex;
|
|
|
|
|
import com.google.android.gms.appindexing.Thing;
|
|
|
|
|
import com.google.android.gms.common.ConnectionResult;
|
|
|
|
@@ -136,13 +137,16 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|
|
|
|
|
|
|
|
|
Toolbar toolbar;
|
|
|
|
|
|
|
|
|
|
public GeoTagActivity() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
setContentView(R.layout.activity_geo_tag);
|
|
|
|
|
toolbar = (Toolbar) findViewById(R.id.toolbar);
|
|
|
|
|
setSupportActionBar(toolbar);
|
|
|
|
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
|
|
|
|
|
|
|
|
|
context = this;
|
|
|
|
|
CommonFunctions.updateLangResources(context, preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
|
|
|
|
|
|
|
|
|
username = preferences.getString(CommonString.KEY_USERNAME, null);
|
|
|
|
@@ -161,7 +165,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|
|
|
|
|
|
|
|
|
db = new GSKOrangeDB(GeoTagActivity.this);
|
|
|
|
|
db.open();
|
|
|
|
|
context = this;
|
|
|
|
|
|
|
|
|
|
//storeid = getIntent().getStringExtra("Storeid");
|
|
|
|
|
str = CommonString.FILE_PATH;
|
|
|
|
|
|
|
|
|
@@ -266,31 +270,15 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|
|
|
|
fabcarmabtn.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
|
|
/* List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
|
|
|
|
for (int n = 0; n < list.size(); n++) {
|
|
|
|
|
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
|
|
|
|
Log.d("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
|
|
|
|
Log.d("TAG", "package name : " + list.get(n).packageName);
|
|
|
|
|
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
|
|
|
|
defaultCameraPackage = list.get(n).packageName;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
_pathforcheck = storeid + "GeoTag" + visitData.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(context).replace(":", "") + ".jpg";
|
|
|
|
|
|
|
|
|
|
_path = CommonString.FILE_PATH + _pathforcheck;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
startCameraActivity();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
|
|
|
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
|
|
|
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
|
|
|
|
|
// client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean checkPlayServices() {
|
|
|
|
@@ -414,7 +402,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|
|
|
|
protected void onStart() {
|
|
|
|
|
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
|
|
|
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
|
|
|
client.connect();
|
|
|
|
|
// client.connect();
|
|
|
|
|
if (mGoogleApiClient != null) {
|
|
|
|
|
mGoogleApiClient.connect();
|
|
|
|
|
}
|
|
|
|
@@ -443,17 +431,12 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|
|
|
|
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//usk comment
|
|
|
|
|
/* if(client!=null && mGoogleApiClient!=null){
|
|
|
|
|
AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
|
|
|
|
if (mGoogleApiClient.isConnected()) {
|
|
|
|
|
mGoogleApiClient.disconnect();
|
|
|
|
|
}
|
|
|
|
|
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
|
|
|
|
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
|
|
|
|
client.disconnect();
|
|
|
|
|
// AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
|
|
|
|
if (mGoogleApiClient.isConnected()) {
|
|
|
|
|
mGoogleApiClient.disconnect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
// client.disconnect();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -614,19 +597,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//usk comment
|
|
|
|
|
/* public com.google.android.gms.appindexing.Action getIndexApiAction() {
|
|
|
|
|
Thing object = new Thing.Builder()
|
|
|
|
|
.setName("GeoTag Page") // TODO: Define a title for the content shown.
|
|
|
|
|
// TODO: Make sure this auto-generated URL is correct.
|
|
|
|
|
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
|
|
|
|
|
.build();
|
|
|
|
|
return new Action.Builder(Action.TYPE_VIEW)
|
|
|
|
|
.setObject(object)
|
|
|
|
|
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
|
|
|
|
|
.build();
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class GeoTagUpload extends AsyncTask<Void, Void, String> {
|
|
|
|
|
|
|
|
|
@@ -1148,4 +1118,17 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Action getIndexApiAction() {
|
|
|
|
|
Thing object = new Thing.Builder()
|
|
|
|
|
.setName("GeoTag Page") // TODO: Define a title for the content shown.
|
|
|
|
|
// TODO: Make sure this auto-generated URL is correct.
|
|
|
|
|
.setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
|
|
|
|
|
.build();
|
|
|
|
|
return new Action.Builder(Action.TYPE_VIEW)
|
|
|
|
|
.setObject(object)
|
|
|
|
|
.setActionStatus(Action.STATUS_TYPE_COMPLETED)
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|