Android Question App to upload videos

justaniceguy

New Member

What I want to do​

I want to create an app that only has a webview and a camera view and does the following:
  1. The user will only use on website in a webview and think this is the app.
  2. When the user visits some specific URL pattern (http://localhost:8000/post/<post_id>/upload-video?post_type=<post_type>) it should open the camera and temporarily store the post_id and post_type.
    Example: In this case of the URL http://localhost:8000/post/1125/upload-video?post_type=co it should open the camera and store the "1125" as the post_id and "co" as the post_type.
  3. Then, when the user records a video, I want him to be able to see the video and decide if they want to save it or re-record it.
  4. When they save it, they should save it to a website via API. This is an example of how it would be saved using CURL:
Bash:
curl -X POST http://localhost:8000/api/post/ \
    -F "post=1125" \
    -F "media_file=@/path/to/file.mp4" \
    -F "post_type=co" \
    -F "post_sub_type=" \
    -H "Content-Type: multipart/form-data"

5. Finally, They should be redirected to the webview, to some specific URL, for example, http://localhost:8000/post/<post_id>.

What I know and what I don't​

  • Step 1: I know how to create the webview. But I don't know how to use the camera.
  • Step 2: I know how to keep an eye on the visited URL, but I don't know how to test the URL pattern. Neither do I know how to open the camera.
  • Step 3: I guess I can find a way to do it by myself.
  • Step 4: I know there is a way to work with APIs but I don't know how or how to send a recorded video. This is the main reason why I came here.
  • Step 5: I can figure it out. Probably I just need to update the browser URL in the same block that saves the video.

In summary, what do I need​

I would appreciate any help on:
  1. Testing the URL patterns. Does B4A support regex? How can I do it?
  2. Recording videos. I couldn't find any tutorial on that.
  3. Posting the recording video via the API. I had no Idea.
Note: I am new to B4X, and sorry if there are better ways to get my questions answered.
 

MicroDrie

Well-Known Member
Licensed User
Longtime User
Note: I am new to B4X, and sorry if there are better ways to get my questions answered.
First I would like to welcome you to this forum. It contains a huge amount of questions and solutions that are often provided with a piece of program code and complete program solutions can be found. All this can be accessed by using the search option at the top right. You will find everything about using the camera with this search: camera .

Today you can also use AI in your search for a step by step approach solution (but be aware that an correct and error-free answer is not always given!).
 
Upvote 0
Top