Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
application:share() #enhancement - Gideros Forum

application:share() #enhancement

Apollo14Apollo14 Member
edited October 14 in Suggestions & requests
Hi guys!

How can we add native android sharing to Gideros?
application:share(text,url,imageUrl)

If we place this stuff inside GiderosApplication.java, will it work? Or something else has to be done to make it work?
static public void share(String textToShare, String urlToShare)	
	{
		Intent shareIntent = new Intent(Intent.ACTION_SEND);
		shareIntent.setType("text/plain"); 
		shareIntent.putExtra(Intent.EXTRA_TEXT, urlToShare);
		--adding image is too tricky for me : (
 
		startActivity(Intent.createChooser(shareIntent, textToShare));
	}
Thx!
> Newcomers roadmap: from where to start learning Gideros
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)

Comments

  • hgy29hgy29 Maintainer
    It will probably work, but it would be better to make a plugin for sharing I think.
    Actually I began writing one three years ago, but the image sharing part on android was too tricky for me too!

    Likes: SinisterSoft

    +1 -1 (+1 / -0 ) Share on Facebook
  • Apollo14Apollo14 Member
    edited October 14
    hgy29 said:

    It will probably work, but it would be better to make a plugin for sharing I think.
    Actually I began writing one three years ago, but the image sharing part on android was too tricky for me too!

    People suggest sharing remote images with the help of libraries like Glide or Picasso: https://guides.codepath.com/android/Sharing-Content-with-Intents

    Maybe just add simple text&url for now? (and remove it later some day, if image sharing plugin will be added to Gideros)
    application:share(text,url)
    static public void share(String textToShare, String urlToShare)	
    	{
    		Intent shareIntent = new Intent(Intent.ACTION_SEND);
    		shareIntent.setType("text/plain"); 
    		shareIntent.putExtra(Intent.EXTRA_TEXT, urlToShare);
    		startActivity(Intent.createChooser(shareIntent, textToShare));
    	}
    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Sign In or Register to comment.