I been seeing that if we package a video with our app we have to copy it to sd storage therefore taking up twice the space for 1 video to play it.
Is this information correct?
If so why, I use other platforms to create Android apps and they play the video in the apps asset directory (or don't require me to do anything special to).
Why does B4A require this step to play videos when we can load other files directly from the file assets?
AFAIK the native VideoView cannot work with assets files.
It is possible to load a video file stored as a resource file. It will require some Reflection code.
Dim r As Reflector
Dim package As String
Dim id As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
id = r.GetStaticField(package & ".R$raw", VideoNameWithoutExtension)
Ok you may have hit the nail on the head.. You said native video view might be the issue. I have a feeling my other Android development system programmed their own video player.
Thanks for the quick reply, it's a shame there is no easy way to do this, because my search revealed numerous posts where people wanted to play the assets video file.
But so are the other assets I call from my APP if that's the case. Granted videos can be quite large, but coping form a zip to a SD can be slow as well.
Plus some devices do not have SD (cheap Chinese tablets for instance), and one of my newer phones doesn't have an SD call its ext_sd I do not know how this is handled, but I ran in to issues with the ext mount in others apps.
But so are the other assets I call from my APP if that's the case. Granted videos can be quite large, but coping form a zip to a SD can be slow as well.
Plus some devices do not have SD (cheap Chinese tablets for instance), and one of my newer phones doesn't have an SD call its ext_sd I do not know how this is handled, but I ran in to issues with the ext mount in others apps.
Your app must test for writeable external storage on start up or refuse to run:
If File.ExternalWriteble = True Then
Msgbox("SD Card Installed","Woo Hoo!")
'Run your code
Else
Msgbox("No Writable External SD Card or Storage Found","Sux 2 B U")
ExitApplication
End If