How about a DP?

This is an update story for the App’s Mastermind, the 2nd Screen

Hariharan M
5 min readAug 2, 2017

Lets track some past with the prequel designer stories.

This update has got nothing to do with making Auth Calls. So lets leave it at that.

The Commotion on slack with ngrok. I’m the initiater of course :D

A Pre-Note:

From an earlier update story on the UI, readers could’ve caught a faint suspicion on what’s coming with inserting a song or setting a DP. To be more abstract, what is gonna be the plan for a filestore multimedia DB, with now that I can’t tunnel my local endpoint to a public domain 24/7.

Hasura’s fork of ngrok, to expose local setup publlic.

Remind you, with mobile apps, its all about responsiveness and impulse. And my definition for the scope of interactivity and dynamism is a class apart. That leaves me with….. Read the blog on 3rd screen, the Song Page for that :)

How cogent is the response rate with mobile apps?

Reader Note: From the previous post, it should’ve been crystal clear for the reasons to chose to make a plot out of updates :)

What update?

This one is around a feature that’s gripping the selfie world. A DP is almost natural rather phenomenal for most of us today. I wouldn’t deny a requisite factor in my app either.

Those blue circles you’ve been seeing so far are artistic impressions of a profile pic. If you are one of the kind who fronts a formidable personal image over your interests, you are in a must-read story.

The blue circles are testimonial to host a DP.

How to set a DP?

You can add a profile pic to my filestore DB and click open your friends’ anytime. Just tap on their circular minuscules and you zoom into their larger pics on a dusted out ‘Board of New People’, with high resolution.

Note: I don’t wanna get into the filestore details just yet. Look for my 3rd screen.

With the Data models

I’ve got myself a table with just 2 fields, the user_id and a profile image link. And, the your_friends view is now bedecked with a link pointing to an image, so that I get friend_info in one shot.

I still don’t make any statements on the file source :) A link is all I can say.

Note that the image_link is NULL when its not set.

With the Data APIs

There’s one and only one call to fetch the image. Just the link from the profile_image for a a given user_id.

Insert when you’ve got yourself a new pic and you Update when you’ve a stand-in ready. A Select to get your friends’ DP links and of course your DP as well.

Insert a DP
Update your DP
A simple select query to get your DP. The response * is covert for now!
This view was computed from a series of parent views
The hierarchy tracks back to your_friends. The friend_data views are intended to wrap the data fair and square.
friend_data2 is one such view embedding in and outs on your friend’s profle. friend_data3 is inherited from the former & encompasses in its entirety, a tricky feature, the DP link which could be NULLABLE.
I recall that, your friend DPs are fetched in *

Beneath the Cover: I’ve a Shared Preference in place to flag this step if at all the user sets a DP for the first time. Once the flag is true, thereon I update the set record.

Anything in the Mix?

To make the feature beckoning, I’ve an inter-app intent system set. You can capture photos from my app rightaway, without having to hand-operate the Camera app. Your pic gets saved instantly to Pictures Album, Gallery.

You are pinged for permissions, run-time.
Toast showing a success message that your photoshot was pinned to Gallery
If you deny permission, I leave a reader note for you the next-time.

Beneath the Cover

I can start an activity instance of another app from my app and get the response with the content-uri in the onResult call. First I ask for user permissions with camera and file access. This is typical with android versions>5.0. Then, I capture something and create a file into which I trove in the pic. Finally, I put the snap into Gallery for an instant Click-Upload.

Note: I use a professional approach with fileproviders to get legitimate file paths.

What about ‘my’ DP?

If you set a DP, cool, you can’t inflate yours. Coz, you have it saved locally. I want people looking at others for a change :) Your DP is neatly crafted into a disk at top-right of the action bar.

Look at my DP circle, after I’d set one.

But mind you, I’ve tried to snap this strife out of the way, but in vain

Menu bar reloads to prepare options as nav drawers open and close, so that I discard the irrelevant tools showing up. But, this took a toll on my DP, as it refreshes every time. It should be faster with cache :)

Beneath the Cover

  1. I’ve used a zoom in out animation for the display.
  2. I’ve got a Picasso loading the image into a bitmap from an url, for both the icon (which I achieved with a transform function for a croppped circle) & the enlarged views.
There a zoom animation for the DP to hit the porch.

A few other technical points are discussed then and there.

Conclusion

I would commend the DP as a trendy way of finding people when it comes to Social Media. But, I’m happy for how I managed this feature into my own app, with my own data style.

As for when I load these pics, I should really say, I load the entire Home Page script in a shot when the app starts :) . After that, its all dynamic.

Please find my Postman collection here for more. Refer up to the story on Data API calls to know about Postman Collections.

Hope the update helped clearing buffers in the readers’ minds :) Stay amazed.

--

--