View Single Post
Old 02-20-2016, 12:26 PM   #4 (permalink)
MichaelApproved
Administrator
2021 Marathon Kickstarter Backer24-hour Marathon 2017 Fundraiser Backer47-hour Marathon 2016 Kickstarter Backer57-hour Marathon 2015 Kickstarter Backer38-hour Marathon 2014 Kickstarter Backer54-hour Marathon 2013 Kickstarter Backer
 
MichaelApproved's Avatar
 
Join Date: Aug 2005
Location: In bed with your mother
Posts: 961
Rewriting both the iPhone and Android apps - Part 2



This update shows great progress with the episode and guest information. Here's what I added.

- A tab with all guest names and their photos.
- The list of episodes now includes the guest information and their photo.
- Clicking into an episode reveals the episode details screen which includes the notes, guest photos and pictures from the episode.

Struggles
----------------------------
Since the last update, I had to rewrite some of the core code. I was trying to make generic functions that could be reused in much of the code but they turned out to be too generic. I ended up pulling back and writing a custom function for many of the database and API requests. They're fairly similar to each other but different enough to need their own functions.

Screen optimizations have been a struggle. The lists are choppy while scrolling. I think it's because there are so many images on the screen and the way I'm displaying images could be a problem. I've done 90% of the optimizations that I'd like to do. I'll leave the last 10% alone and wait to work on it more when we have the final design in place.

Regarding the image loading, Android has a security feature that's making it difficult to display downloaded images. The problem is the webview isn't allowed to access the data folder. I have to encode the images as base64 content and make the image source a data URL. That slows down the time it takes to display all those images.

Having so many pictures with data URLs could also be adding an extra memory load to the webview. I can do more tests to be sure but what's the point? It's the only way I can display images, so I have to live with it.

There's an alternative way to bypass the Android image security problem. I can include a proxy web service with the app and have that service read the files. The tag would look like src="http://localhost:8000/images/guest-photo-123.jpg" but that's one more chunk of code that I'd have to maintain and another chunk of code that could introduce bugs. Not worth it.

Going forward
----------------------------
My focus for the next update is going to be streaming/downloading the audio files and player controls. I've already done proof of concept tests that have been successful, so I don't think I'll run into major problems. Fingers crossed!

The framework
----------------------------
For those wondering, I'm using Cordova with Ionic framework 1.X with Angular JS 1.X. Both Ionic and Angular have 2.0 releases in beta right now. Those new versions are supposed to have major improvements in performance.

I'm debating whether the performance improvements will be worth moving to the new versions, even while they're in beta. The major concern with moving is that they both changed a lot of their core methods for doing things. I'll have to learn the new stuff and rewrite a good chunk of code to make things work. That'll delay things and we'll also lose access to the large plugin library that's available for the current version.

Will it be worth it? That's a decision for later.
(Offline)   Reply With Quote