pauleffect Member Licensed User Longtime User Jan 23, 2014 #1 Hello. I have this Code: Copy (...) Case "play" Dim input As String = value Log("play " & input) File.WriteString(File.DirApp,"output.txt", input) astreamO.WriteFile("screenStream", File.DirApp, "sS.jpg") Log("sent") (...) in b4j. Async streams, as you noticed. I'm trying to get that file as a background for an image view. I'm trying. My app says: class cast exception: strings can't be cast to android.graphics.bitmap. Code: Copy Select Key Case "screenStream" Dim bmp As Bitmap = Value I give up... If you can help a noob, superb. If not, well.... Guess i'll look for other solutions... Thanks.
Hello. I have this Code: Copy (...) Case "play" Dim input As String = value Log("play " & input) File.WriteString(File.DirApp,"output.txt", input) astreamO.WriteFile("screenStream", File.DirApp, "sS.jpg") Log("sent") (...) in b4j. Async streams, as you noticed. I'm trying to get that file as a background for an image view. I'm trying. My app says: class cast exception: strings can't be cast to android.graphics.bitmap. Code: Copy Select Key Case "screenStream" Dim bmp As Bitmap = Value I give up... If you can help a noob, superb. If not, well.... Guess i'll look for other solutions... Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2014 #2 Value is the name of the file. This code is from AsyncStreamsObject example: Code: Copy Case "file" Dim fileName As String = Value Log("Received file. File size: " & File.Size(astreamO.TempFolder, fileName)) You should use: Code: Copy Dim bmp As Bitmap = LoadBitmap(astreamO.TempFolder, value) Upvote 0
Value is the name of the file. This code is from AsyncStreamsObject example: Code: Copy Case "file" Dim fileName As String = Value Log("Received file. File size: " & File.Size(astreamO.TempFolder, fileName)) You should use: Code: Copy Dim bmp As Bitmap = LoadBitmap(astreamO.TempFolder, value)
pauleffect Member Licensed User Longtime User Jan 23, 2014 #3 Thanks Erel. I messed up. I mistook value for the stuff being sent. As I wasn't sending files until now, was no big deal. Thank you again! Upvote 0
Thanks Erel. I messed up. I mistook value for the stuff being sent. As I wasn't sending files until now, was no big deal. Thank you again!