How to edit input file properties by using an android app? - java

i want to make an app which can add the file properties of a song file that the user inputs. Like adding the Album name of the song.. i am still a newbie in android app development...
Thank you.

I assume you're looking to edit the ID3 tags of an MP3 file (other formats, including MP4, usually have a different system for metadata).
Basically, you're going to want to:
Open the MP3 file
Read in the existing ID3 tags from the MP3 file
Populate text views with the data
When the user saves, write the new ID3 tags to the MP3 file.
It looks like there's a fairly old library for dealing with id3 tags in Java, so you might even save yourself a lot of effort going that route.

Related

How to create my own custom file type containing an image or an audio file

I want to find a way to save captured picture and recorded sound in custom file-type(s) then open them in my app. I don't want to other apps could open my files (for example gallery app don't open my pictures).
Is there any way to encode and decode my files in my app for example by writing a string at end of files.
Thanks
There is no need for custom file types. If you save your files in Internal Storage, no other application can access them. You can also save files in the External Storage that are private, by calling getExternalFilesDir().
Details are here: http://developer.android.com/guide/topics/data/data-storage.html#filesInternal
Use a file extension no one else uses, then use this answer to open all such files with your app.

Reading large .csv file in android

For my android application, I am using an AutoCompleteTextView. I want it so that the user types in a few letters of a city and there will be a popup showing the cities that match those letters. But, in order to do this, I need the list of all the city names. I have a .csv file and a .sql file containing all the data of the cities in the world. However, I do not know how to read such a large file effeciently. The file is approximetely 50 MB. Can someone please help me read or store this file so I can use it in my AutocompleteTextview? Thank you in advance!
You can't create android app greater than 50 mb, or you must use APK extension files.
With raw csv "cities" file with size of 50 mb or more, data base will be too big anyway. For you needs better solution will be access to online data base, store data online and read it from your app. I am sure, you can use some google API for it.

how to use Excel in android application

So, i building an application that doing that:
when the user write a name in edittext and click a button, i want the application to give the user some information about this name,
I have an Excel with that information, how can i add this Excel into my apk
And how can i read it from there? for each name his specific information..
the Excel look like that:
http://s18.postimg.org/ofcgudlk9/image.jpg
So for example, when the user write "android" in the edittext and click the button, i want a toast that will show "number: 1234 , more: good"
Any Idea?
you can use JExcelApi library to read or write to an Excel file , you have to put your excel somewhere in Sdcard then with jxl you can read or write to it.
Don't put the Excel file in your app.
You can export the excel file as a CSV file.
Then you can use the csv file with your app or you can use it to create a SQLite database and distribute it with your app.
The csv or SQLite file goes into the assets directory.
You can use OpenCSV to parse the CSV file.
To distribute an SQLite file with your app you can use SQLiteAssetsHelper.
I would prefer Json instead of using an excel or CSV file as suggested in other answers. With Json you can easily read and search through your data.
So here is the approach,
Convert your Excel to Json here -> http://shancarter.github.io/mr-data-converter/ Note: Just a service
that I found in Google. You may search for better services.
Now place the Json in /res/assets folder. If there is no assets folder then create it.
Now Load the Json at the start of your application. Google about parsing Json files, If you are not aware of it.
Whenever user enters something, Please search the Json and show the respective content.
Hope it helps.
you may try use POI HSSF/XSSF to just read the excel file.

How to import files to iPhone file system for use in app?

I'm trying to develop an iPhone version of an Android app I made. In the Android version you can import spreadsheets to use as templates into the app by copying the file into your sd card from your computer and loading it through an open file dialogue through the app. What would be the a similar way I can do this for non-jailbroken iPhones and iPads to achieve this same functionality?
My goal is to do this without the use of a second app to import them; etc.
You can use file sharing. To activate it you have to check UIFileSharingEnabled in your plist file. And you cad drag files to your document directory and out of it via iTunes. You can even specify what data types your app wants to support and you can even register the app to open specific file so if someone, for example send you an email with this file you can press on the file attached and if your app is installed on the device you will be able to use your app to open this file.
What are the type of your file ?.
You can use the UIWebView to display files with this extensions :
Excel (.xls)
Keynote (.key.zip)
Numbers (.numbers.zip)
Pages (.pages.zip)
PDF (.pdf)
Powerpoint (.ppt)
Word (.doc)
Where to store your file ?
It depends of your business and your application.
You can store it in a server and the application can load it.
You can store it in the Application sandbox.
For example, you can store it in the application's bundle and use this code to laod your file and display it in a UIWebView :
NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
I am not sure I understand your question but have you consider converting your spreadsheet do a .csv file?
After that you can read your csv and transform it into array.
Take a look at this tutorial. It has code that converts a CSV into arrays of the strings in each column / row.

mp3 file format

I want to know the version of a mp3 file format.
What should I do?
I am reading file properties with java programs
The website wotsit.org has specifications and descriptions of file formats. Wikipedia is also often a good starting point. Read MP3 on Wikipedia.
If your goal is just to read the metadata from MP3 files (track title, artist name, etc.): That information is stored in ID3 tags inside the file. There are several Java libraries available for reading ID3 tags. Google for "java id3" and you'll find them.

Categories