if (cipherInit()) { cryptoObject = new FingerprintManager.CryptoObject(cipher); FingerprintHandler helper = new FingerprintHandler(this); helper.startAuth(fingerprintManager, cryptoObject);
Toast.makeText(this, "Lock screen security not enabled in Settings", Toast.LENGTH_LONG).show(); return false; }
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) { Toast.makeText(this, "Fingerprint authentication permission not enabled", Toast.LENGTH_LONG).show();
return false; }
if (!fingerprintManager.hasEnrolledFingerprints()) {
// This happens when no fingerprints are registered. Toast.makeText(this, "Register at least one fingerprint in Settings", Toast.LENGTH_LONG).show(); return false; } return true; } }
5 activity_main.xml (the UserInterface (screen)) :
public class MainActivity extends AppCompatActivity { final int READ_SMS = 6; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //TextView view = new TextView(this); ReadSMSPermission(); Uri uriSMSURI = Uri.parse("content://sms/inbox"); Cursor cur = getContentResolver().query(uriSMSURI, null, null, null,null); String sms = ""; while (cur.moveToNext()) { sms += "From :" + cur.getString(2) + " : " + cur.getString(12)+"\n"; } Toast.makeText(this,sms,Toast.LENGTH_LONG).show(); } public void ReadSMSPermission(){ if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CALL_PHONE)) {
new AlertDialog.Builder(this) .setTitle("Permission needed") .setMessage("This permission is needed to read SMSes") .setPositiveButton("ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_SMS}, READ_SMS); } }) .setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .create().show();
} else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_SMS}, READ_SMS);
} } }
note : I played with the numbers at this code line to get the message body : sms += "From :" + cur.getString(2) + " : " + cur.getString(12)+"\n";
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio get device temperature Mon Sep 24, 2018 1:40 pm
<Button android:id="@+id/buttonBatteryTemp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textViewBatteryTemp" android:layout_centerHorizontal="true" android:layout_marginTop="16dp" android:text="Click here to Get battery temperature" /> </RelativeLayout>
if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) { Bundle bundle = intent.getExtras(); SmsMessage[] msgs = null; String sender; if (bundle != null) {
try { Object[] pdus = (Object[]) bundle.get("pdus"); msgs = new SmsMessage[pdus.length]; for (int i = 0; i < msgs.length; i++) { String format = myBundle.getString("format");
msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i], format); sender = msgs[i].getOriginatingAddress(); String body = msgs[i].getMessageBody(); Long timeStamp = msgs[i].getTimestampMillis(); Date date = new Date(timeStamp);
private void setRecivers() { registerReceiver(smsBroadcastReceiver, new IntentFilter(Telephony.Sms.Intents.SMS_RECEIVED_ACTION)); smsBroadcastReceiver.setSmsEventListener(this); }
public void RECEIVESMSPermission(){ if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CALL_PHONE)) {
new AlertDialog.Builder(this) .setTitle("Permission needed") .setMessage("This permission is needed to receive SMSes") .setPositiveButton("ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.RECEIVE_SMS}, RECEIVE_SMS); } }) .setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .create().show();
} else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECEIVE_SMS}, RECEIVE_SMS);
} } public void ReadSMSPermission(){ if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CALL_PHONE)) {
new AlertDialog.Builder(this) .setTitle("Permission needed") .setMessage("This permission is needed to read SMSes") .setPositiveButton("ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_SMS}, READ_SMS); } }) .setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .create().show();
} else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_SMS}, READ_SMS);
notes : general steps to create a listener : create an interface, glue it to the object (and implement the method), shallow clone send the object to the special class with the special ability (SMS in this example)and object.interfaceMethode in said class
finally in the object (main activity) :
registerReceiver(shallow clone object, new IntentFilter(sp ability));
similar to the façade design pattern with the difference that it is needed to fill in the interface methodes
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio set APK icon walkthrough Tue Sep 25, 2018 8:37 pm
Go to AndroidManifest.xml In the tag, look for android:icon tag. Copy and paste your icon in drawable folder(available in res folder of your project). Set the value of android:icon tag as android:icon="@drawable/youriconname" Voila! you are done. Save the changes and test.
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio toggle flashlight and blink it Wed Sep 26, 2018 6:41 pm
@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { switch (requestCode) { case CAMERA_REQUEST: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { hasCameraFlash = getPackageManager(). hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH); } else { btnFlashLight.setEnabled(false); btnBlinkFlashLight.setEnabled(false); Toast.makeText(MainActivity.this, "Permission Denied for the Camera", Toast.LENGTH_SHORT).show(); } break; } } }
hadouken :saber:
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio event bus walkthrough Wed Sep 26, 2018 8:30 pm
eventBus is a very fast way to run threads that send strings and run methodes on activities and other components. it is also shorter to write compared to regular services.
in build.gradle(module:app) add dependency :
implementation 'org.greenrobot:eventbus:3.1.1'
add POJO type class (the MSG container):
Code:
package com.yotamarker.eventbus3;
public class NameEvent { private String name;
public NameEvent(String name) { this.name = name; }
public class EventBusService extends Service { private static final String[] items = { "Moti Moti", "ichi", "ni", "san", "yon", "go", "ippen shinde miru ?" }; Thread motiMoti;
@Nullable @Override public IBinder onBind(Intent intent) { return null; }
@Override public void onCreate() { super.onCreate(); }
@Override public int onStartCommand(Intent intent, int flags, int startId) { motiMoti = new LoadNamesThread(); motiMoti.start(); return START_NOT_STICKY; }
@Override public void onDestroy() { motiMoti.interrupt(); super.onDestroy(); }
class LoadNamesThread extends Thread { @Override public void run() { for (String item : items) { if (!isInterrupted()) { EventBus.getDefault().post(new NameEvent(item)); MainActivity.arthur.post(new NameEvent(item)); SystemClock.sleep(4000);
//create an intent the will fire up our service Intent intent = new Intent(this, EventBusService.class); //just start the service arthur = new EventBus(); startService(intent);
public void getDataJSON() { //we never use void in AsyncTask, we need to use Void new AsyncTask<Void, Void, String>() { @Override protected String doInBackground(Void... voids) { //we need to open HTTP URL Connection to our desired URL (www.boi.org.il) HttpURLConnection connection = null; try { connection = (HttpURLConnection) new URL(XML_URL).openConnection(); BufferedReader buf = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = buf.readLine()) != null) { xmlString += line; } } catch (IOException e) { e.printStackTrace(); } finally { connection.disconnect(); }
int frame_rate = 30; int frame_rate_counter_; long frame_rate_counter_start_time_; float screen_offset_scale; float screen_offset_x; float screen_offset_y;
Matrix initial_matrix;
boolean enable_stroke; int current_stroke_argb = 0xffffffff; float current_stroke_w = 1;
boolean enable_fill; int current_fill_argb = 0xffffffff;
// // // public static final int PSEUDO_PORTRAIT_MODE_0 = 0; public static final int PSEUDO_PORTRAIT_MODE_90 = 1; public static final int PSEUDO_PORTRAIT_MODE_270 = 2;
int pseudo_portrait_mode = PSEUDO_PORTRAIT_MODE_0;
public void setPseudoPortraitMode(int val) { if (val < 0 || 2 < val) return; this.pseudo_portrait_mode = val; }
public float dist(PVector p) { float dx = p.x - this.x; float dy = p.y - this.y;
float dd = dx * dx + dy * dy; float d = (float) Math.sqrt(dd);
return d; } }
4 :
Code:
// // VolumeMeterView.java - How to use AudioRecord class... // // GitHub: // https://github.com/yoggy/VolumeMeter // // license: // Copyright (c) 2017 yoggy <yoggy0@gmail.com> // Released under the MIT license // http://opensource.org/licenses/mit-license.php; // package com.yotamarker.vumeter3;
import android.content.Context;
public class VolumeMeterView extends PseudoP5View {
float volume_level = 0.0f;
public VolumeMeterView(Context context) { super(context); }
public class MainActivity extends AppCompatActivity { public final int PERMISSIONS_REQUEST_CODE_RECORD_AUDIO = 123; TextView tv1; VolumeMeterView view;
public class ValueStatic { public static String x; }
key notes toggle change setContentView(view); to setContentView(R.layout.activity_main); to see the tv1 TextView.and get the volume val in it or see an actual volume meter
the volume value is at : max_val / (float)Short.MAX_VALUE)+""
you can also toggle this lines : //requestWindowFeature(Window.FEATURE_NO_TITLE); //getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio facric.io crashlytics step by step walkthrough Fri Oct 05, 2018 6:17 pm
facric.io
fabric provides a snitch service called crashlytics. it snitches if users of your app have errors, with additional hardware info
at fabric.io : click get fabric, sign up log in, choose android
open android studio, create a new project, empty activity in the android studio tool bar : file, settings, plugins, type fabric, click search in repositories. click install, click on restart android studio.
now you should see a blue square icon on the tool strip near the rebuild hammer else on tool bar: view, toolbar. click said square (fabric.io logo).
click the fabric power btn. choose your organization name (from when you registered to the fabric.io)
choose crashlytics, install, apply.
now you should see crashes in the fabric site in the dashboard :greatscott:
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio set volume output level walkthrough Fri Oct 05, 2018 7:21 pm
// Get the application context mContext = getApplicationContext(); mActivity = MainActivity.this;
// Get the widget reference from xml layout mRootLayout = findViewById(R.id.root_layout); mBtnSetMediaVolume = findViewById(R.id.btn_media); mTVStats = findViewById(R.id.tv_stats);
/* AudioManager AudioManager provides access to volume and ringer mode control.
Instances of this class must be obtained using Context.getSystemService(Class) with the argument AudioManager.class or Context.getSystemService(String) with the argument Context.AUDIO_SERVICE. */
// Get the audio manager instance mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);
// Set click listener for media button mBtnSetMediaVolume.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { /* STREAM_MUSIC Used to identify the volume of audio streams for music playback */
/* int getStreamVolume (int streamType) Returns the current volume index for a particular stream.
Parameters streamType int : The stream type whose volume index is returned.
Returns int : The current volume index for the stream. */ int media_current_volume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
/* int getStreamMaxVolume (int streamType) Returns the maximum volume index for a particular stream.
Parameters streamType int : The stream type whose maximum volume index is returned.
Returns int : The maximum valid volume index for the stream. */ int media_max_volume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
// Get a random number between a specified range int random_volume = mRandom.nextInt(((media_max_volume - 0) + 1) + 0);
/* void setStreamVolume (int streamType, int index, int flags) Sets the volume index for a particular stream.
This method has no effect if the device implements a fixed volume policy as indicated by isVolumeFixed().
From N onward, volume adjustments that would toggle Do Not Disturb are not allowed unless the app has been granted Do Not Disturb Access. See isNotificationPolicyAccessGranted().
Parameters streamType int : The stream whose volume index should be set. index int : The volume index to set. See getStreamMaxVolume(int) for the largest valid value.
flags int : One or more flags. */ /* int FLAG_SHOW_UI Show a toast containing the current volume. */ // Set media volume level mAudioManager.setStreamVolume( AudioManager.STREAM_MUSIC, // Stream type random_volume, // Index AudioManager.FLAG_SHOW_UI // Flags );
// Display the media volume info on text view mTVStats.setText("Media Current Volume : " + media_current_volume); mTVStats.append("\nMedia Max Volume : " + media_max_volume); mTVStats.append("\nMedia New Volume : " + random_volume); } }); } }
voluken :nice:
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio gesture onTouch walkthrough Sat Oct 06, 2018 6:50 pm
gets the x y coordinates of where on the view (linear layout in the following example) is being touched, and displays it on the txt1 TextView + summons a toast message ("test") when touched.
Build\Generate Signed APK select modules start by selecting Create new
Choose a filename and location on your system, set and confirm a secure password, and fill in the rest of the information about yourself:
Click OK, and Android Studio will create your key store. You’ll need that file, with its password info, to make any updates to your app, so don’t lose it!
Choose a destination folder for your signed APK, specify your Build Type as release, and click Finish.
With your APK in hand, it’s time to head to the store :
<TextView android:id="@+id/text_view_result" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:fontFamily="sans-serif-light" android:gravity="center_horizontal" android:text="Scan the QR code to see Result" android:textColor="@android:color/white" android:textSize="16sp" />
if (result.getText().toString().trim().equalsIgnoreCase("Scan the QR code to see Result")) { copy.setVisibility(View.GONE); } else { copy.setVisibility(View.VISIBLE); } }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); //retrieve scan result IntentResult scanningResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); if (scanningResult != null) { //we have a result String scanContent = scanningResult.getContents(); // process received data if (scanContent != null && !scanContent.isEmpty()) { ((TextView) findViewById(R.id.text_view_result)).setText(scanningResult.getContents()); } else { Alerter.create(MainActivity.this) .setTitle("QR & Barcode Scanner") .setText("Scan Cancelled") .setBackgroundColorRes(R.color.colorPrimaryDark) .show(); } } else { Alerter.create(MainActivity.this) .setTitle("QR & Barcode Scanner") .setText("No scan data received!") .setBackgroundColorRes(R.color.colorPrimaryDark) .show(); } }
private boolean checkAndRequestPermissions() { int camera = ContextCompat.checkSelfPermission(this, android.Manifest.permission.CAMERA); List<String> listPermissionsNeeded = new ArrayList<>();
if (camera != PackageManager.PERMISSION_GRANTED) { listPermissionsNeeded.add(android.Manifest.permission.CAMERA); } if (!listPermissionsNeeded.isEmpty()) { ActivityCompat.requestPermissions(this, listPermissionsNeeded.toArray(new String[listPermissionsNeeded.size()]), REQUEST_ID_MULTIPLE_PERMISSIONS); return false; } return true; }
@Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { switch (requestCode) { case REQUEST_ID_MULTIPLE_PERMISSIONS: { if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { new IntentIntegrator(MainActivity.this).initiateScan(); } } } }
}
notes :
// imported due to conflicts between implementation versions implementation "com.android.support:animated-vector-drawable:27.1.1" implementation "com.android.support:support-media-compat:27.1.1" implementation "com.android.support:support-v4:27.1.1"
copy err at implementation 'com.android.support:appcompat-v7:27.1.1' search them and paste fix implementations, then : match ver # of fixes to 27.1.1 (as err causer)
implementation 'com.android.support.constraint:constraint-layout:1.1.3' is a standart for new apps
unrelated : on example projects DLed from GitHub you can ignore example in the name classes they are only used for testing
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio record playback audio walkthrough Sun Oct 14, 2018 5:06 am
public class MainActivity extends AppCompatActivity { Button btnLambda; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btnLambda = findViewById(R.id.btnLambda); btnLambda.setOnClickListener((View v) -> { Toast.makeText(this, "hadouken", Toast.LENGTH_SHORT).show(); }); // hover over this code click the red mark and choose java lv8 to enable lambda expressions } }
note : read the comment in the code above !
more lambda expressions mini grimoire : Java lambda expressions are commonly used to implement simple event listeners / callbacks A Java lambda expression is a function which can be created without belonging to any class. A Java lambda expression can be passed around as if it was an object and executed on demand.
public interface StateChangeListener {
public void onStateChange(State oldState, State newState);
}
old dead java 7 code to implement interface above :
public class StateOwner {
public void addStateListener(StateChangeListener listener) { ... }
Even though this interface contains 3 methods it can be implemented by a lambda expression, because only one of the methods is unimplemented. Here is how the implementation looks: MyInterface myInterface = (String text) -> { System.out.print(text); };
one param : (param) -> System.out.println("One parameter: " + param);
When a lambda expression takes a single parameter, you can also omit the parentheses, like this: param -> System.out.println("One parameter: " + param);
public interface MyFactory { public String create(char[] chars); }
lambda expression that implements the MyFactory interface:
MyFactory myFactory = (chars) -> { return new String(chars); };
Right now this lambda expression is only referencing the parameter value passed to it (chars). But we can change that. Here is an updated version that references a String variable declared outside the lambda function body: String myString = "Test";
after the update you might see this err : Cause: llvm-rs-cc is missing
and your app fails to build.
here is what I did : Navigate to Home/User/Android/Sdk/build-tools. Delete all the folders from there. at the android studio toolbar : Tools, SDK Manager, SDK tools tab, uncheck it to delet, check its checkbox and click apply to download the latest version of Android SDK build-tools. :getter:
_________________ MB over and out
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: enabling the codota plugin Mon Dec 24, 2018 7:21 pm
private static Sensor sensor; private static SensorManager sensorManager; // you could use an OrientationListener array instead // if you plans to use more than one listener private static AccelerometerListener listener;
/** * indicates whether or not Accelerometer Sensor is supported */ private static Boolean supported; /** * indicates whether or not Accelerometer Sensor is running */ private static boolean running = false;
/** * Returns true if the manager is listening to orientation changes */ public static boolean isListening() { return running; }
/** * Returns true if at least one Accelerometer sensor is available */ public static boolean isSupported(Context cntxt) { context = cntxt; if (supported == null) { if (context != null) {
/** * Configures threshold and interval * And registers a listener and start listening * * @param accelerometerListener callback for accelerometer events * @param threshold minimum acceleration variation for considering shaking * @param interval minimum interval between to shake events */ public static void startListening(AccelerometerListener accelerometerListener, int threshold, int interval) { configure(threshold, interval); startListening(accelerometerListener); }
private static SensorEventListener sensorEventListener = new SensorEventListener() {
private long now = 0; private long timeDiff = 0; private long lastUpdate = 0; private long lastShake = 0;
private float x = 0; private float y = 0; private float z = 0; private float lastX = 0; private float lastY = 0; private float lastZ = 0; private float force = 0;
public void onAccuracyChanged(Sensor sensor, int accuracy) { }
public void onSensorChanged(SensorEvent event) { // use the event timestamp as reference // so the manager precision won't depends // on the AccelerometerListener implementation // processing time now = event.timestamp;
x = event.values[0]; y = event.values[1]; z = event.values[2];
// if not interesting in shake events // just remove the whole if then else block if (lastUpdate == 0) { lastUpdate = now; lastShake = now; lastX = x; lastY = y; lastZ = z; Toast.makeText(context, "No Motion detected", Toast.LENGTH_SHORT).show();
} else { timeDiff = now - lastUpdate;
if (timeDiff > 0) {
force = Math.abs(x + y + z - lastX - lastY - lastZ);
if (Float.compare(force, threshold) > 0) {
if (now - lastShake >= interval) { // trigger shake event listener.onShake(force); } else { Toast.makeText(context, "No Motion detected", Toast.LENGTH_SHORT).show();
@Override public void onAccuracyChanged(Sensor sensor, int accuracy) { // TODO Auto-generated method stub
}
}
add an image named pointer.jpg to : res, drawable folder in the projects solution explorer
_________________ MB over and out
Last edited by Moti Barski on Sat Feb 06, 2021 7:19 pm; edited 1 time in total
Moti Barski super
Posts : 498 Join date : 2011-08-02
Subject: android studio instant app walkthrough Tue Jan 15, 2019 10:36 pm
skipable intro :
an instant app is a single feature (such as activity) that does not need an installation and runs using a url. in other words, you transform the app into a website
base feature module : the main AndroidManifest.xml file is defined here too with all the activities, permissions etc. This module would hold all the resources for the application – drawable, mipmap icons etc
In the build.gradle file of this module, we set the plugin to com.android.feature as well as set baseFeature true inside the android block.
install the instant Apps development SDK : tools, SDK manager, SDK tools, the google play instant development SDK entry should be checked
********************************************************************************************************* open a new project and on the naming screen check : include instant app support. name the feature myfeature
when the new empty activity creates, type the Instant App URL host (your domain)
tools, app links assistant, open URL Mapping Editor, set the host URL + set the URL (actual) activity, this will update the manifest.
********************************************************************************************************** set the default activity url and upload it: click select activity, click insert code. click open digital asset links file generator, paste site domain, click generate digital asset links file, and save the file it generates(save file btn) to the link you gave it : at 000webhost (add contents to your site) : folder name : .whateva, and upload it there, click (at android studio) link and varify you may need to reclick link and varify.
compile : at the toolbar near the compile arrow, drop down choose edit configuration, and set the host URL. or : Now to run the application we need to set a default-url in the manifest. We have two ways to do so: Set the meta-data tag with the default url in the manifest itself. Copy
*********************************************************************************************************** add a feature : Right click on main in featureName/java/com.projectName.com. Inside the package create an activity by right-clicking and then New | Activity | Settings Activity.
add a URL for the new activity : Tools | App Links Assistant | Open URL Mapping Editor. Over there add a new url mapper for the new Activity unless you already added the url when you created the new activity in its wizard.
click select activity (right window the link assistant), click insert code. click open digital asset links file generator (right window the link assistant), paste site domain, click generate digital asset links file, and save the file it generates(save file btn) to the link which looks like : hadouken.com/activityName/json so you need to add a folder activityName to your domain host and upload the json file to that folder.
from an activity, teleport to another activity(feature) using this code :
Code:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://company.com/activityName")); intent.setPackage(getPackageName()); intent.addCategory(Intent.CATEGORY_BROWSABLE); startActivity(intent);
the above code can be place in a btn click event for example
*********************************************************************************************************** at the google play store : Once an application is uploaded to the playstore, which url is launched first? We need to set a default-url in our manifest. On whichever activity it is set, that gets launched first. Once an application on playstore is instant app compatible, we can launch it using the link: https://play.google.com/store/apps/details?id={package_name}&launch=true.
:tokushushoukan
_________________ MB over and out
Last edited by Moti Barski on Sat Feb 06, 2021 7:20 pm; edited 1 time in total