Android Video Capture Implementation


#1

Hey All,

I’m working on integrating video capture into the Android application for ushahidi. I have the android project set up on my PC, and was hoping I could get information about how to get started on the development of the feature. If possible, I would love to skype / chat about possible starting points.

Background: I am a computer science student at CMU and hope to contribute to ushahidi’s android app as part of a course I’m taking named software development for social good.

Thanks,

afahim


#2

First you might want to look into how to record and save the video on the device – http://developer.android.com/training/camera/videobasics.html

Then look into how to submit it to a video hosting service like YouTube since the Ushahidi API doesn’t allow you to upload videos.

Let me know if you have specifics


#3

@afahim Let me know if you hit a blocker or something. I’m here to help.


#4

@eyedol I actually have hit two issues and it would be great if you can help!

I’ve looked into capturing video on android devices. However I’m having issues with the app. (1) I can’t seem to run it on my Nexus 4 phone (the phone isn’t recognized by eclipse as a device which can run the app). I am thus running on the emulator. (2) However when I open the demo.ushahidi.com demo on the app inside the emulator, the app crashes and quits with the following error message in logcat

    04-07 13:37:59.876: E/AndroidRuntime(750): FATAL EXCEPTION: main
    04-07 13:37:59.876: E/AndroidRuntime(750): java.lang.NullPointerException
    04-07 13:37:59.876: E/AndroidRuntime(750): 	at com.ushahidi.android.app.fragments.BaseMapFragment$MapMarker.addMarkerWithIcon(BaseMapFragment.java:233)
    04-07 13:37:59.876: E/AndroidRuntime(750): 	at com.ushahidi.android.app.ui.tablet.MapFragment.populateMap(MapFragment.java:404)
    04-07 13:37:59.876: E/AndroidRuntime(750): 	at com.ushahidi.android.app.ui.tablet.MapFragment$3.run(MapFragment.java:373)
    04-07 13:37:59.876: E/AndroidRuntime(750): 	at android.os.Handler.handleCallback(Handler.java:615)
    04-07 13:37:59.876: E/AndroidRuntime(750): 	at android.os.Handler.dispatchMessage(Handler.java:92)
04-07 13:37:59.876: E/AndroidRuntime(750): 	at android.os.Looper.loop(Looper.java:137)
04-07 13:37:59.876: E/AndroidRuntime(750): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
04-07 13:37:59.876: E/AndroidRuntime(750): 	at java.lang.reflect.Method.invokeNative(Native Method)
04-07 13:37:59.876: E/AndroidRuntime(750): 	at java.lang.reflect.Method.invoke(Method.java:511)
04-07 13:37:59.876: E/AndroidRuntime(750): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-07 13:37:59.876: E/AndroidRuntime(750): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-07 13:37:59.876: E/AndroidRuntime(750): 	at dalvik.system.NativeStart.main(Native Method)

#5

For the device to show up in Eclipse make sure you’ve the Developer Options enabled and USB debugging checked. Also increase the target SDK number to 19 and install android-19 from SDK manager. This way the app can be run on Android 4.4 devices.

The app is crashing because you don’t have the Google API running on your emulator instance. Make sure you create a device with Google API image. Will have to fix this so this gives a decent error message than crashing.


#6

@afahim any updates? Let me know if you need help.


#7

@eyedol I’ve completed implementation of the video upload feature. I now have an interface that allows a user to select a a video while creating a report. The video then gets uploaded to vimeo and the user is given a link to the URL of the video. The video can also have different tags and privacy settings can be set as well.

I was hoping I could discuss some UI considerations and code organization questions I had with you, if you get some time. Do let me know!


#8

This is awesome. We can have an IRC chat. I’m available this week from 9am JST. Let me know what day and time works for you.


#9

@eyedol How does Tuesday (today) at 11am JST sound?

I’m pretty flexible with that time so if some other time before or after suits you better, do let me know.


#10

Okay. Let’s do tomorrow 11am JST?


#11

@eyedol would a slightly later time work for you? Let’s say noon JST?


#12

@eyedol I’m actually free 11 AM JST as well, talk to you then on IRC.


#13

Sure. I’m on.