Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] Android: deliver plain text data to another app user with clickable image via sms/mms

Posted on November 11, 2022 By

Solution 1 :

There are so many questions being asked here, not a single one

How can I attach the data to the image so that when it is clicked on by the user it opens the app, saves the data and then shows the new CardView

The answer is you can’t do anything like that automatically. You need to manually implement some code for receiving that push and then create the card instance in your recycler yourself.

My suggestion based on your database comments, is to have your recyclerview monitor your db with live data to create those card instances. You just store each card you receive.

Would an SVG image file work in this case because links can be embedded within the SVG?

That kind of security and privacy violation would probably (deservedly) get an app banned, so don’t do that

Would an AppWidgetProvider and RemoteViews work here?

That’s completely unrelated to anything here, that’s for adding dynamic content to the home screen

when the receiving user clicks on the image in the SMS text, the app would be opened

Monitoring users sms is a touchy subject now, for both users and for Google. Ensuring that your app handles a link clicked in an sms (even a dynamic link) is error prone and difficult now. A much better idea than sending sms (which also costs the user money) is to use any kind of pub-sub model. Lots of libraries and services offer this. Firebase can be used this way too.

Solution 2 :

I’m not sure if its possible what you are looking for, but I think your best approach would be to use firebase dynamic links.

READ  [FIXED] specifically in SQLite on android, do views need to be "refreshed" if you change the schema of the table they are built off of?
Powered by Inline Related Posts

Problem :

I have a RecyclerView list of CardViews that hold a small amount of user data. The data is saved to the app’s SQLite database. I would like to send a CardView’s data from one app user to another via SMS/MMS. The SMS is sent when the user clicks the share icon on the CardView. Then when the receiving user clicks on the image in the SMS text, the app would be opened/brought to the forefront, the data would be saved in the recipient’s SQLite database and then the RecyclerView list would be shown with a new CardView from the data that was passed via SMS.

I am able to attach the image to the SMS text message and am able to send and receive the image and the message:

enter image description here

How can I attach the data to the image so that when it is clicked on by the user it opens the app, saves the data and then shows the new CardView in the RecyclerView list? Would an SVG image file work in this case because links can be embedded within the SVG? Can I save the data in a JSONObject and attach it to the SVG and then when the user clicks on the image the JSON can be parsed in the app, saved to the database and then the updated UI for the RecyclerView list of CardViews can be shown? Would an AppWidgetProvider and RemoteViews work here? Or is there another way to attach data to the image that can be passed to the receiving app once the user confirms their acceptance by clicking on the image?

MainActivity

...
public void onShareIconClick(View view, Card cardFromShareIcon, int clickPos) {

    final Intent smsIntent = new Intent(Intent.ACTION_SEND);
    String phoneMsg = "here's a card for you:";
    smsIntent.putExtra(Intent.EXTRA_TEXT, phoneMsg); 
    smsIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    smsIntent.setDataAndType(shareUri,getContentResolver().getType(shareUri));
    smsIntent.putExtra(Intent.EXTRA_STREAM,shareUri);
    try {
        if (smsIntent.resolveActivity(getPackageManager()) != null) {
            startActivity(smsIntent);
        }
    } catch (Exception e) {
        Log.w(TAG2, "Could not open Text Messenger app", e);
        // Inform user
        Toast.makeText(this,
        "Could not open your Text Messaging app.",
        Toast.LENGTH_LONG).show();
    }
}

Comments

Comment posted by AJW

Much thanks for the idea. I will check out the links to see if that approach can work.

READ  [FIXED] android - Full screen notification intent won't work from service
Powered by Inline Related Posts

Android Tags:android, android-recyclerview, sms

Post navigation

Previous Post: [FIXED] java – Access Binding Adapters in multi module project
Next Post: [FIXED] java – Changing value in on item also changes in another item – RecyclerView Android

Related Posts

[FIXED] android – ERROR: “E/AndroidRuntime: FATAL EXCEPTION: main” Android
[FIXED] android – Iridescence effect in OpenGL ES 2.0/3.0. Replacing the black area Android
[FIXED] Gradle Task to get Android App Bundle Manifest Android
[FIXED] android – Unable to stop handler despite calling removeCallbacks(runnable) Android
[FIXED] android studio – issues in access in kotlin when using “when” statement Android
[FIXED] kotlin – What is the difference between _uiState.asStateFlow() and StateFlow = _uiState in ViewModel Jetpack Compose Android

Archives

  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Can Vicks humidifier be used without filter?
  • What color is Spanish green?
  • How old is Jamie in The War That Saved My Life?
  • When should I use scalp massager for hair growth?
  • Can I put polyurethane over liming wax?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme