2017년 3월 31일 금요일

Need Help - > Sharing Sounds


i built an App where u can play different sounds bei clicking on different buttons.

now i want to add the option, that u can share a sound with friend etc. (for example to share in whatsapp)

The easiest way would be, if i could just link the uploaded sound in the app with the share button. But there ist no way to do this?


In the First Picture u see how i did it then. The Problem ist, this way is just working with my phone. but other phones who downloaded my app, cant send the audios.
The Sounds are playing everywhere on everyphone. 

Isnt there now a easy way to share the sounds ?

i searched for days in the internet for other ways anb cant find out how this should work. i read something about to put the sounds online. but how can i link the uploaded files with the share option? Isnt the no way to share "offline". What i mean with offline is, is that the app has already the sounds uploaded with the sound player.

Sorry for the bad english. i hope u could understand my problem ?

1.PNG 표시 중

--

The easiest way would be, if i could just link the uploaded sound in the app with the share button. But there ist no way to do this?


copy your file from the assets to the sdcard, you can use the file extension https://puravidaapps.com/file.php for that  and then use the share component to share it from there

--
thank you for your help!

i hope i understand you right: So i have to put the Sounds on the SD Card
and share it from there?

I already tried to share two sounds from the SD Card. (see the picture) The path is working and playing on myphone.
With my phone i can share it. everything is fine.
 but if i share the .apk on other phones its not working to share anything.
(because they havent the sounds on their sd card, right? )

So the problem ist still the same, or?



-- 
1. put your sounds into the assets as you had it earlier
2 before sharing a sound, copy that sound from the assets to sdcard using the Copy method from the file extension
3. share the sound from sdcard

I also do not get it, why i should change the file directory on my phone to the sd card with a programm in appinventor. why not just copy and paste in the phone itself on the sd card? isnt it easier this was?  or what did i not understand?

you only can share files from the sdcard, but your sounds are in the assets of your app
to be able to share, you first have to copy your sounds somehow to sdcard
to copy a sound to sdcard, use the Copy method
hope that helps

-- 
thank you again. I now did is as u described. (see picture).

Hopefully i did it correct?

i upload the apk now and will try it on other phones. i will report if its working now


but i dont get the theory after this. u said "you only can share files from the sdcard". But the sharing funktion worked on my phone with the path to the assets. i can share sounds with other phone (for example with whatsapp). i also tried with sounds from the sd card and it worked.

But if you install the apk on other phones, the sharing wasnt working. because they havent the sounds on their device. why should copieng to the sd card fix the prob? :-/   u see, im a noob. so thank u a lot for helping me to fix this prob

best regards from germany




-- 
its still the same. 

I cant share the sound. 

Two Errors:

When the Screen initialize: "Sorry, file to copy does not exist" (as i said, how do u want to copy a file, which doesnt exist on your device? ) again: on my phone its working, but not on other phones.
and when i click to share: "Error 2001: The file file:///storage/emulated/extsdcard/xxxxxxxx could not be found on your device.

any ideas?

-- 
But the sharing funktion worked on my phone (with the path to the assets on my phone). i can share 
But if you install the apk on other phones, the sharing function isnt working anymore. because they havent the sounds on their device.
as you found out yourself, the path /AppInventor/assets exists only on your development device so obviously it does not makes sense to use that path, does it?

also other people probably do not have an external sdcard.... therefore you should copy the file from the assets to the internal sdcard
to correctly copy a file from the assets to the internal sdcard see the documentation of the Copy method here https://puravidaapps.com/file.php

also you might want to follow the rule "DRY -Don' repeat yourself". Avoid redundancy,  see also http://twodogapps.com/?page_id=686#Redundancy and http://twodogapps.com/?page_id=686#Procedures and learn to use procedures... 


A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here:  http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here:  http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
 Top 5 Tips: How to learn  App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

-- 
thank you a lot.I didnt want to annoy someone. Im Sorry for that, i just repeated because i thought, maybe u didnt understand exactly what i mean (my english).

Thank you for the tipps, im already doing the tutorials and triying a lot. In the next App (because this projekt is already finished and working well. the last thing is just sharing) i will try to avoid the redundancy and built it "clever". I already saw that :)

I saved the link with the book. i didnt know the book yet. thank u. 

the only problem for me personaly is, to be honest, the language. its hard for me to understand everything in english :(  if u have somethinh in germany, so please let me know :)

to the problem with my app:

"to correctly copy a file from the assets to the internal sdcard see the documentation of the Copy method here https://puravidaapps.com/file.php"


Ok i did it wrong with the external sd card. So just put the path to the internal SD Card? isnt the rest correct like in the link https://puravidaapps.com/file.php ? because i did it with that.

My question is:  (i'm really sorry for the questions if they are too stupid) why should this work? When the app is running it tries to copy the files from the assets to the internal sdcard right? but isnt the problem, that on other phones there is nothing to copy from assets, because they havent the sounds?

if i am right (im sure im not :D  ) ->

i was already looking for alternatives and found this: How can I share an mp3 file

the guy asked for the same thing and uploaded everything, so when the app is running, its downloading first. Sounds good?

-- 
Ok i did it wrong with the external sd card. So just put the path to the internal SD Card? isnt the rest correct like in the link 
It would really help if you provided a new screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.


When the app is running it tries to copy the files from the assets to the internal sdcard right?

only if you like to share a sound, then copy the file, you might want to use a procedure for that
that procedure could take the file name as input parameter, copy the file to sdcard, share it and delete it again from sdcard


 but isnt the problem, that on other phones there is nothing to copy from assets, because they havent the sounds?

if you upload the sound files into the assets, the sounds are stored inside the app, so everybody who uses the app does obviously have the sounds inside the app, you only have to access them correctly...


i was already looking for alternatives and found this: How can I share an mp3 file 
the guy asked for the same thing and uploaded everything, so when the app is running, its downloading first. Sounds good?

in 2014 the extension feature was not yet available
of course you also can download the sound files from somewhere in the internet

-- 
thank you for your help and explanations. 

Its now working fine! U can see my way on picture 1. (and maybe use it, if the same question will came again from another person)

But i havent it yet with clever procedures (because newbie, im working on it). Im not deleting the sounds on the SDCard. i do a "secret folder" in android/data and let the sounds there (just 7 mb). So the programm does not have to copy it again and again (dont know if its exactly working this way, but everytime i open the app (or Screen is initializing), ist not getting more.

Thank u again for helping and your patience :) I think, this thread can be closed now




-- 

댓글 없음:

댓글 쓰기