Developing Android application having Image and audio - android

I am in process of designing an Android App :a poetry application, which would
a. display the poetry
b. audio controls - start, stop, restart, move for poetry
There are currently collection of 25 poems and it may update in future.
One way is to
Approach 1. Make a static app with all available content and update the app regulary with newer contents
Advantage: Easy to develop as everything is static
Disadvantage: App would be heavy as it would contain lot of content.
Approach 2 Is it possible to put content seperately from the app,ex. app is installed and the content is placed on external storage memory. Using this mechanism, everytime there is a update, the content can be replaced with new contents (approach 2 = a very light weight player capable of showing content (may be in form of image) and audio capabilities + a separate location where content (images+mp3) are placed)
Approach 3. Make a hybrid app, as the user request for a content , the content is downloaded at run time and played using android audio capabilites.
Approach 4. Make pure HTML5 based web app.
Is there any other possibility ? Which option is more beneficial from user experience point of view.
Many thanks in advance

I would go with Approach 2,5, it is a mix of Approach 2 and Approach 3 where you save the downloaded file to a database so you do not download the same file multiple times and then play it.
Some clarification, as I understood Approach 2 would only have more poems if there was a Google Play update and Approach 3 was streaming. Using Approach 2,5 you will get the storage from Approach 2 and the playback from Approach 3.
Update: The term I was looking for was to synchronize data. Approach 2,5 is really just a way to download for instance a JSON and parse it then download the files and put it in a database where the app later can access it. With this approach the user need not update the app and if you want to remove a poem that is also possible.

Related

Downloading certain part of audio and continue downloading the rest when reaching a certain point in the audio

I want to create an app for sharing audio files. I want to build native mobile apps and made most of my progress on android with a PHP/MySQL backend so far. But now I want to step up my game and build my backend with Node.js and MongoDB.
Since big audio files take a while do download and can worsen the user experience I wondered if it is possible to just download the first 20% of an audio file. When the user reaches a certain point of the audio it downloads the rest/the next section. Therefore, we do not need to download the entire audio that might never get used. I just wonder if it is that difficult to add another section of the audio while playing without any interruptions.
For some reason I think this is how the big social media apps work but I cannot find any sources on this topic. I don't ask for code but just suggestions and references to help me. Am I on a good track or are there are ways to solve this problem? Also can you recommend to use Digital Ocean Spaces for this task??
Sources for Android and IOS will be very helpful!
You can do it by providing a "Range" attribute to the header of the HTTP-Request you are sending to the Digital Ocean space for the desired media file. The "Range" attribute says the number of bytes you want to receive.

How to handle data in android

Im working on a self-test app.
And I wondering on how to store the data, I've got over 200 questions and more is on the way.
Was thinking of storing them as XML but didnt find a way to get a random question without reading the whole string-array to a variable, which is bad for the memory.
So the correct way to go is to use a SQL-database, right?
But how do I make such a database so that it exists at boot and dont need to be made during start up?
Can't seem to find any tutorial on this subject, on how to handle questionnaires.
Here's a good tutorial on SQLite and Content Provider. It'll introduce you to using SQL databases on Android, and wrapping them into a ContentProvider.
As for how to get the data to the device - you have two options:
You pack the SQLite .db file in the application assets folder. Pros: the database is ready for consumption on the first run of the app. Cons: your .apk is too big. Updating is hard.
You download the data on the first run. Pros: your .apk is slim. updating is easy Cons: there's a delay before the user can use the app.
You ship a small .db file with the first 10 questions. Pros: Your users can start using the app immediately, while you download the rest of the questions in the background. Cons: You have to pick 10 questions you're likely to never or rarely change, or you risk your app to start with outdated data.
Create the db offline and either put it in the apk or download it.

Android App to access locally stores files, PDF, HTML and video

We have a mobile workforce using Android Galaxy tabs and use the MobiControl MDM product to sync detailed briefing files to and from the devices on a constant basis.
Rather than having the user search through a sea of irrelevant briefs in order to find the one they want, and to provide a nicer more activity specific UI, I would like to create an app which allows a user to tap a client from a list and then show links to the relevant files plus custom content such as recent news and summaries of activity.
I started to create locally stored HTML files (saved on the internal sdcard) with the idea of creating an app to access them using webviewer but have ran into a few problems...
1) What is the best way to access files that are stored on the sdcard using webviewer? loadData? string?
2) Although the files will be stored in client specific folders, the file names will change on a ongoing basis and these ever changing file names should be the titles of the links to allow the user to identify what they need.
Still very much at the preliminary stages of thinking and r&d so suggestions on the best route to take to achieve my goal is very much appreciated.
Ad
1) What is the best way to access files that are stored on the sdcard using webviewer? loadData? string?
loadUrl() should work.
BTW, your item "2)" is not a question.

Add and load images, videos and pdfs from a raw folder or an SDCard Android Tablet design?

Good day, I have a requirement to create a kind of book app with pdfs, images and videos worth up to 10gb and more on a tablet locally. Now there is no intention to sell it on the android market or any other store, its completely in house, so i think issue with apk size has been clarified. What am asking is, where is the best place to put all this contents so that i can readily load them up and use them accordingly?
Should i be using the raw folder and create sub-folders for each images, videos and pdfs?
Should i create folders on an sdcard(assuming there is one in place)? or
Please if you have any other solution or ideas on how to implement this, I would gladly like to hear this. Thanks for your responses in advance.
P.S by the way, since its a tablet specific app, is there any need to have a multi-pane layout fragment or ii can just use all the space. thank you
I suppose you can use a RAW folder, but it would also make the APK size huge from what I understand because all the files in the RAW folder need to be packaged with the application.
From what I've seen in the past, most applications, actually most games, that have lots of extra data will download the additional data on first launch. Basically:
The application launches
It checks whether or not you have all the additional data (Books, pdfs, images)
If not, it starts downloading that data to the SDCARD.
It may not make sense in your situation, but doing it this way gives you more finite control over how much data needs to be downloaded. If function A only requires package A of additional data, then you only need to download package A, you don't need to download everything. Or perhaps you could let the user choose what packages of additional data they want to download, which would also save bandwidth, time and resources.

How to detect New Version Of Website using Android Application?

I have an android application that's a "link" to a magazine website.
The activity of the application would be the magazine website itself.
I've made a widget for it and I run a service that as one sole purpose: to detect when a new magazine is online. When the service detects it changes the widget icon.
Now my doubt is how can I detect a new magazine. I was thinking about download a file from the website every 6 hours and compare the version of the last magazine (I may start with 0 as a local variable for the application and compare with the number provided by the document downloaded).
Is there a better way to do it?
It depends what you consider to be a "change". Assuming you want to detect any changes, download the magazine homepage/other file and perform an MD5 or similar hash on it. Store the hash.
Next time you do a download, you hash it again then compare hashes. If the hashes are identical, the page is unchanged. The benefit of the hash is the reduced storage requirements - you only need to save a handful of bytes, not a whole document.
Be aware, however, that most pages are NOT static - imagine a page with a clock in the corner or any dynamic content - in this scenario, your page will always appear to be different.
For some well-run sites and servers, you may be able to look at the HTTP headers to get information about when the page was created/modified/is set to expire. This won't be provided by everyone and can sometimes just be plain wrong.
The ideal solution is to find one particular page (or part of a page) which will onlu change once with every new issue - then you can just keep checking that one thing. An example of this might be a link that always points at the latest issue or the url for the main image which changes with each issue.
Of course, if the magazines are willing to help, they could expose the information to you in a number of ways from a simple file with just an issue number inside to a full-on webservice.
Edit: Assuming multiple magazines under your control, I'd suggest you have a single page that returns a list of the latest issues for each magazine in a readily parsable format (JSON, XML). This list could be static if issues are infrequent/a very manual process - in which case, edit it by hand. Even better would be a simple database table which is read to generate the list - This way you can have a nice UI to update it and allow someone else to maintain it without giving them access to the server file system.
I'd also suggest that you assign a truly unique id/key to each magazine and to each issue of that magazine - so that in future, you can add other functionality like downloading locally for offline reading / syncing back issues.

Categories

Resources