ma1co / OpenMemories-Framework

Build Android apps for your favorite Sony camera
MIT License
236 stars 35 forks source link

Dependency to Android? #9

Closed jbieler closed 6 years ago

jbieler commented 7 years ago

I can't see a dependency to android currently, as it doesn't work in android studio out of the box. Is that correct? But isn't the project only usable on an android system? Here's my suggestion:

Does that make sense to you?

I already started bringing more functionality into the framework. For example I added Log4j to improve Logging: There is a LogActivity showing a fullscreen log field and the camera will send out all log messages to a configurable server that prints them to the console. I think this will help a lot, since we will get rid of the cumbersome 'remove SD card to see logs' procedure.

I'm starting with a fork on the framework and I'd be happy to push the results back to you.

pdykmans commented 7 years ago

Hello Jochen,

Sorry to contact you this way, but I'm not very familiar with Github yet. So, I didn't see any other possibility...

First a bit of background;

I just joined Github to take part in this Sony App development. As a C# programmer I should be up to speed with Java in no time I guess. However I'm still very much confused about Android programming, Gradle, and how OpenMemories ties it all together.

In an effort to get started, I just installed Android Studio and downloaded the FocusBracket app from user Obs1dium. My goal was to start "somewhere" and create an APK file that I could then load onto my A6000 using the pmca-gui application. And while I managed to build the APK file, it doesn't want to load onto the camera. But this was just a quick test. No big deal...

Now for my actual question;

Would you maybe have some time to get me jump started? There's just too many loose ends for me right now. Like: can we use Android Studio? Is there a Sony device emulator? What's wrong with my APK that it doesn't load? etc...

Your help would be appreciated!

Thanks, Philippe

ma1co commented 7 years ago

@pdykmans

can we use Android Studio?

Yes, I recommend you to use it.

Is there a Sony device emulator?

No. You can use the Android emulator or your phone for very simple apps. But as soon as you use Sony's proprietary APIs, the app will crash in the emulator, because the APIs are only available on cameras.

The easiest way to develop is using adb. Using OpenMemories-Tweak, go to the developer tab and turn on wifi and adb. Connect the camera and your computer to the same network. On your computer, run adb connect <your camera's ip>. In Android Studio, click the run icon and select your camera. The app should start on the device. Set your camera's auto-power-off-setting to 30min to prevent it from shutting down.

What's wrong with my APK that it doesn't load?

Please provide us with the error messages. I guess that you might have certificate problems. Uninstall the original FocusBracket app from your camera and try again. You can't update an app if it is signed with a wrong certificate.

pdykmans commented 7 years ago

Thanks for the info ma1co!

Meanwhile I managed to compile APK's in Android Studio. I just made a couple beginners mistakes. But I can now load and run them on my A6000 without problems :-)

My next steps will be to look into some of the apps already available and see if I can add some value. Just to get familiar with the environment, which is 90% new to me.

Just one more question, if you don't mind; I have been looking high and low for documentation on the Sony API. But whatever function or namespace that I google-search for, I always end up with references to OpenMemories or Android. Do you know of any documentation from Sony? E.g. what functions are available on which of their cameras?

Thank you! Philippe

ma1co commented 7 years ago

No, there is no official documentation, everything we know was found through reverse engineering. I'd recommend you to look at existing apps.

Regarding availability on different cameras: There are comments in the stub files (e.g. MediaRecorder was added in API version V3 = 2.3). You can find the list of supported cameras with their respective API versions here (e.g. A6000 is 2.4 = V4).

pdykmans commented 7 years ago

Ok, thanks a lot ma1co!