Is there any simple library for iOS devices (i.e. iPod/iPad/iPhone)?
The specific thing I need to do is transfer an mp3 file to a connected iPod, if anyone has a code snippet for that or something. I don't see a way to do this with the file system, as I don't see how to find my iPod in it. I'm thinking I might need to use it as a media device somehow?
Thanks! :)
PS: I was able to find libipod, but this is written for c++, and I don't wish to use JNI
Related
Is there any way to load a sound samples from memory using SoundPool.load method?
Unfortunatelly, all methods provided in SoundPool are using arguments for real files.
The problem is that I want to load sounds from zip file on SDcard, and extracting zip (like in this solution) is not an option.
Furthermore, there is a solution for loading from uncomressed zip files, but my files is comressed (and will be with password).
So is there any way to have java.io.FileDescriptor that represents a virtual file, so I can implement some abstract class placing my own streams?
Best regards.
I got the final answer on this question.
This is feature-missing on Android platform. Android media playback framework doesn't support it for a very long time. Google also notices it, so Android6.0(API Level23) introduces android.media.MediaDataSource which could be used as a pure memory byte-array data source. Before API Level23, we still need to copy the memory data to a temporary file in the file system.
The following URL provide some more clues on this issue, its explanation is correct for both audio and video:
how to play video from byte array in media player
I wanted to suggest you to use MemoryFile, but after checking it, I found the MemoryFile has no getFileDescriptor() method, it means we couldn't use it as a parameter in SoundPool.load().
But I found this post:
what is the use of MemoryFile in android
One guy implemented MemoryFileUtil.getFileDescriptor(memFile), he posts his codes there.
If his codes really could work, it means we could load a sound sample from memory using SoundPool.load().
The only problem is writing our memory data into that memory file.
The following site shows how to write memory data(from SQLITE query result) into a memory file:
http://www.programcreek.com/java-api-examples/index.php?api=android.os.MemoryFile
I'll give you updates after my test.
Using Java I need to be able to create an empty CD image and also to inject/extract files into/from this image. Do you know any java libs for that? Is there a way to accomplish it without using JNI? (if not, then your JNI solution is appreciated). Thank you guys.
PS. This task is required for data transportation between emulated environment created by Qemu emulator.
In principle this is simple to implement, just write a file that is properly structured as CD-image. In practice thats probably a lot of work.
Simply googling for "java create iso image" reveal there is already an implementation to do just that: http://jiic.berlios.de/
I want to record audio and save to my server as mp3 files, i googled and find like this
But it is not free and open source
How can i record audio as mp3 in java and php ?
In terms of Java, you could record with standard Java sound and then use something like lameonj to do the mp3 encoding - all free tools!
This question is the same as yours and the person was able to come up with a solution (which he posted as an answer).
A little additional information. It is possible to record sound in an applet. See this page for information on Java Sound and applets. You'll need to sign your applet, which isn't hard to do. The answer to question 5 doesn't mention this but you can create your own (untrusted) certificate with which to do the signing. This question here on SO has some information on self-signing code.
I solved my problem, I used lame library to encode mp3, If you want to pure code to encode mp3, you can use this
Its using java based lame library
I'm currently developing an application for a company which includes livescoring. The XML-files I access (from the net like: "http://company.com/files/xml/livescoring.xml") are not intended to be public and should only known to me.
I was wondering if it is possible for anyone to decode the .apk file and read my original .java files (which include the link to the XML files).
So, I renamed the .apk file to .zip and could access the "classes.dex", which seemed to include the .java files (or classes). Googling led me to a tool named "AvaBoxV2" which decoded this "classes.dex" file. Now I have a folder including an "out" folder where files named .smali exist. I opend one of these with an editor and finally there is the link to the xml file. Not good. :(
Is there a way to encrypt my app or the classes.dex file? I don't want to tell that company, that anyone can access the original xml-files. Maybe signing the app probably helps?
Also, do you know a really noob-friendly tutorial to prepare apps (signing, versioning,...) for Google Market?
Thanks in advance!
The .java source code is not included in the APK.
It is possible to disassemble the Dalvik bytecode into bytecode mnemonics using a tool like baksmali, but there's no way a user can recover the original .java source.
Furthermore, you can use a tool like proguard (included in the Android SDK) to obfuscate your byte code, making it hard to interpret the behavior of the disassembled bytecode.
You can make small tricks too, like storing the link string in some sort of obfuscated form, and then de-obfuscating it at run-time in your app (a simple example would be to use base 64 encoding, but someone could probably reverse that quickly if they wanted to).
That said, it's pretty trivial for someone to run tcpdump and sniff the network traffic between your device and the server, and get the URL that way, so there's no way to completely prevent anyone from getting this value.
Yeah, its impossible to fully prevent something like this. Its the same on a desktop application, or any other application.
As mentioned, obfuscation will help, but people who are persistent can still get past it. Especially for something like a url like that.
One solution of making it much more tricky for hackers is to use PHP on your webserver and some sort of token system to determine if the request is coming from your app or not... That would get a bit tricky though, so I don't really suggest it.
Hey all, i'm new to web development so i'm really dumb when it comes to tools for working on it. I have .amr files recorded from my BB application that are sent and saved on a server. I want to be able to play these files via a webplayer on a website, I have a couple of questions regarding this:
1) Would it be sound to convert these files to something like mp3 o wav instead of trying to play using the amr format? The sound files are received by a java web service and saved as files on my hard drive with the URL saved on a MySQL database. So if a conversion method is suggested I would prefer it be in Java.
2) What player can I use and how, to play these files? Be it the amr files or converted files
3) How can I create a link that will point to said audio file so people can go to it and hear it? I know this differs a little from my original question line but I have to able to do it as well.
thanks in advance
1) MP3 or wav would be a good idea. You could use something like LAMEonJ (http://openinnowhere.sourceforge.net/lameonj/) for wav -> mp3. And with luck there's something similar for AMR.
2) Is the <audio> tag in HTML5 likely to be an option? The users could then play the file directly in the browser, and you could just render HTML on the website, rather than providing it through a webservice.
I think you are suggesting an applet on a web page, that connects to the server via a webservice, which would certainly be possible but a lot more work.
Otherwise, if you're just serving a music file, you're not going to be able to control what player is used on the client side, once they have your file they can do with it whatever they like.
The only down side of HTML5 is that they'll need a relatively recent browser.
3) If you're using <audio> then this is already taken care of.
If you google for the <audio> tag I think you'll find a lot of information,as well as strategies for providing alternative players to older browsers.