r/androiddev • • Nov 12 '17

The android developer starter pack

https://imgur.com/gallery/OFsMt
762 Upvotes

89 comments sorted by

View all comments

9

u/cheunste Nov 12 '17

As a new dev...I don't get the bottom right. Will some of the stuff I run into in the future be so overly complex and confusing that I need a migraine medicine or what?

0

u/[deleted] Nov 12 '17

[deleted]

3

u/cheunste Nov 12 '17

Avoid the camera at all costs.

Is there a particular reason why?

12

u/[deleted] Nov 12 '17

Manufacturers implement it differently. A common bug is displaying a bitmap without using exif rotation data so the image is sideways.

On older Samsungs the camera was a huge MegaPixel size but the app didn't have much allocated memory. If your app does image manipulation you had to compress it when loading it from the harddrive. Loading a full size image to memory and trying to manipulate would just crash the phone.

Currently im trying to handle gallery intent requests robustly, but the apps that can handle gallery intent requests return results so differently. Some don't even have the image yet, they just return a file that is getting an image downloaded to.

0

u/[deleted] Nov 12 '17

[deleted]

13

u/Atraac Noone important Nov 12 '17

I'd genuinely say, make your own camera or use CameraKit/CameraView, anything really. Camera apps are so absolutely shit on Android you'll never get a proper result. Some camera apps return you the URI, some return the thumbnail, some try to return full bitmap. In theory all should save a file properly if you give them URI to save to. But Samsung doesn't give a shit and some particular models with particular OS versions won't even save a file for you. Exif data being whole different story.

5

u/w3bshark @w3bshark Nov 13 '17

After using the intent for capturing pictures within the past few weeks, I would say don't use it.

You don't get any info about the rotation of the image on many devices and you can't infer the rotation like you can if you have an instance of Camera.

There is no good way of knowing if you need to display the image rotated 90 vs. 270 vs. whatever with the capture intent.

2

u/Pavle93 Nov 13 '17

Orientation sensors.

2

u/squeeish Nov 13 '17

The Nexus 5X

0

u/[deleted] Nov 13 '17

[deleted]

3

u/cheunste Nov 13 '17

Wait...they seriously named an API "Camera2"? Are you serious?

0

u/[deleted] Nov 13 '17

[deleted]

1

u/cheunste Nov 13 '17

My god...

7

u/pjmlp Nov 12 '17

Yes, stay away from NDK if you want to keep sanity.

3

u/baggyrabbit Nov 13 '17

The JNI syntax without an IDE was brutal.

3

u/puppiadog Nov 13 '17

Different screen size and resolutions means multiple files of the sam3 code to handle each situation plus testing the same functionality over and over in different emulators and devices.

Also, for me their XML-based UI can be very frustrating.