[Q] Using tinyalsa in android application - Java for Android App Development

Hi,
I'm trying to figure out how to use tinyalsa in my android app to record audio.
I know of the following ndk libs: tinyalsa and tinyalsa-ndk, but I couldn't figure out how to wrap them using java calls, and where to obtain valid parameters (e.g. card, device). I also know that it requires root, but I couldn't find out why - am I required to push files somewhere, grant rw permissions to something or something else?
I'm not looking for a ready-to-go wrapper library (although I would certainly not mind one), just some starting point for undertanding how to use it.
Many thanks

What are you trying to achieve with tinyalsa? Standard Android recording API doesn't satisfy your needs?

surlac said:
What are you trying to achieve with tinyalsa? Standard Android recording API doesn't satisfy your needs?
Click to expand...
Click to collapse
I'm trying to write a Call Recorder for myself that does not rely on Standard API recorders (e.g. MediaRecorder or AudioRecord).

Related

Capture video on Android devices

Hey all, I was wondering if anyone could tell me if there's a way to capture video of the Android OS/homescreen/apps in the same way that you can screenshot these things. I'd like to take a video of Google navigation and walk through the different features it has, but capturing video through an external camera generally ends up as very low quality.
I recall screenshots having to be taken (early on at least) only when it was linked with a computer and some portion of the dev toolkit. Is that still the case for screenshots? Does anyone know if there's a similar feature that would capture video when connected to a laptop or something? Thanks for the input!
Hey, you may use Android Screen Video Capture Tool for capturing currently displayed screen as a video for recording program demos to upload to YouTube or problem recreation
Or creating a set of videos answering your most frequently asked questions
You can create video tutorials for school or college class
Use to record a recurring problem so you can show technical support people
Create video-based information products you can sell
Record new tricks and techniques you discover on your favorite software program, before you forget them
I hope it would be helpful!
Also, if you are rooted, the app ShootMe takes screenshots and screencasts.
Sent from my perfect epic
I usually use Camtasia, even in lite version it does the job. Launch the Android emulator on your SDK, start the camtasia video capture, start your app and acquire your video.
Don't forget to set a compression plug-in otherwise you'll have too large videos.
I prefer Broadcaster Studio. It,s free.
But i think he means on the Andorid device, not on the PC.
i am building an app that will have the ability to do this.
http://code.google.com/p/groundwork/downloads/list
I temporarily took out the video option to speed up the processing. Until enough people want it I will put it back in.
Also until I deploy the apk you will have to be rooted and use adb or a terminal to use
the command
cat /dev/graphics/fb0 | netcat 9000
edit:
I am at work now. When I get home I can put the video option back in the code
SuperUserMovado said:
i am building an app that will have the ability to do this.
http://code.google.com/p/groundwork/downloads/list
I temporarily took out the video option to speed up the processing. Until enough people want it I will put it back in.
Also until I deploy the apk you will have to be rooted and use adb or a terminal to use
the command
cat /dev/graphics/fb0 | netcat 9000
edit:
I am at work now. When I get home I can put the video option back in the code
Click to expand...
Click to collapse
It will work on honeycomb?
I don't have a honeycomb tablet so I don't know. This should work on a rooted tablet with busybox installed. I have the atrix which actually outof the box doesn't allow users to read the framebuffer without modifying the kernel. I doubt motorola has done this with the xoom.
The app is released in the android market. You will need to download and install python to run it on your phone. I am going to release an update to record video shortly.

[Q] Firesheep app for Andriod

Hello all,
Its been a long time no speak on this forum for a while, I have finally made the jump from WM (HTC LEO/SE X1) to Android on a Dell Streak. Admittedly I am still waiting on a stable o2 sanctioned version of Froyo to put SENSE UI on!
My question here relates to Firesheep, an add on for Firefox that allows packet capture on public WiFi networks. I was wondering if anyone could port this application to android as a stand alone App, or if anything else similar had been developed?
I hope someone can give me an answer at least to the feasibility of this request.
+1
I too would love to know hehe
Sent from my Desire HD using XDA App
It would require drivers for the wireless chipset in the phone to be put in promiscious/monitor mode to capture packets, as far as I know, neither is possible, unfortunately.
timekeeper said:
It would require drivers for the wireless chipset in the phone to be put in promiscious/monitor mode to capture packets, as far as I know, neither is possible, unfortunately.
Click to expand...
Click to collapse
Couldn't it run in firefox mobile
monitor mode in galaxy S
There is an app available in market called pixie who get the promiscuous mode for the wifi interface. I'm able to capture packets in Samsung Galaxy S (GT-I9000) with the app installed.
Now we're waiting for firesheep realease for android... it's impossible to install the XPI in Firefox mobile beta...
Yeah, I tried porting the XPI over to firefox mobile, but it wont work without a packet capture utility, like WinPcap, which is used with the normal Firefox Win version.
I would be definately interested in seeing where this goes though...
vit_mar said:
Yeah, I tried porting the XPI over to firefox mobile, but it wont work without a packet capture utility, like WinPcap, which is used with the normal Firefox Win version.
I would be definately interested in seeing where this goes though...
Click to expand...
Click to collapse
It is also working in OSX so I guess libpcap should be enough to use it. By reading this http://seclists.org/tcpdump/2010/q1/98 it seems that there is support for Android. However you will need root access to use it.
This thread, discussing Shark for Root app, refers to a lot of functions that firesheep uses: http://forum.xda-developers.com/showthread.php?t=725692
Perhaps using libpcap/tcpdump (as janfsd suggested), we can port this over. Root is a must though, true...
any updates?
i need this for my N1
Tanks
Bumping for an update on this project!
Found this thread in google. Try http://faceniff.ponury.net/ I've wrote it yesterday I wrote it to sniff only facebook accounts but it can be easily modified to other services.
Hello!!
This is awesome! wooow! I don't mean the fact that you can steal web session profiles,
but the fact that an Android application can open an interface e.g. WIFI and realise sniffing -
network monitoring without being run as root or system. To do so, an application should be
signed with the platform's key : http://stackoverflow.com/questions/6010796/run-secure-api-calls-as-root-android
How is this possible?? I am really wondering about that. Some time ago I tried to port
jNetPcap, so as to use it in an Android application for monitoring the WIFI. I successfully
ported it but I couldn't read the list of Android interfaces from its API and realise web
monitoring.. (see here for details: http://stackoverflow.com/questions/5966603/jnetpcap-on-android-problem-with-findalldevs-method,
http://jnetpcap.com/node/792)
I am really wondering how faceniff faces this problem??
e.g. Shark for Android runs an instance of libpcap in the background and derives the
appropriate information from the pcap traces..
What faceniff do to get the information it wants, e.g. the web sessions?? I am
really curious about that.. Any ideas?
faceniff runs as root....
Yes, but how is it possible to make an application that runs as root?
There is no Android permission you can use in Android manifest to give you
such privileges.. Even other Android applications that run only in rooted phones
cannot open an interface an capture traffic, and for this reason they run in the
background a tcpdump and process the pcap traces it produces (e.g. Shark for
Android).
is anybody here that knows how faceniff can capture packets??
I know how it works because I wrote it
It has a binary file which lies in /data/data/net.ponury.faceniff/
Then the java app executes "su" (to gain root permissions) and executes that binary file. And it grabs results from the binary showing them on the screen. Hope it helps.

[Q] Call recording directly from android system on rooted device

Hi All,
I'm writing a small call recording library for my rooted phone.
I saw in some application that recording is done through ALSA or CAF on rooted phones.
I couldn't find any example / tutorial on how to use ALSA or CAF for call recording (or even for audio recording for that matter).
I saw tinyAlsa lib project, but I couldn't figure how to use it in an android app.
Updated my question: I'm looking for a way to record system sound directly, preferablly not a platform dependant one. I saw some hints referring to AudioFlinger but could not found how to use it in an Android application.
Can someone please show me some tutorial or code example on how to integrate ALSA or CAF such a solution in an Android application?
Thanks!
I have the same problem.
Please can anybody help?
Sent from my GT-I9505G using XDA Free mobile app
I refined my question, hopefuly this will help with directing me to a solution... thanks for the help

[Q] Library to record user interaction with my app

I have a small app. And for testing, I want to record what people do in the app. What I mean, I would like to log every button press, swap etc in my app, so later I can do most popular "scenarios" using UIautomator for testing.
Is there any library for that? I have tried Google, but there was only some B2B company, and UIautomator uses adb for capturing events.
Have you tried using the Google Analytics API? This should be exactly what you are looking for.
johndow1 said:
I have a small app. And for testing, I want to record what people do in the app. What I mean, I would like to log every button press, swap etc in my app, so later I can do most popular "scenarios" using UIautomator for testing.
Is there any library for that? I have tried Google, but there was only some B2B company, and UIautomator uses adb for capturing events.
Click to expand...
Click to collapse
The most straightforward way I can think of with the SDK is just to make some subclasses of things like
Code:
View.OnClickListener
and do some custom logging in there. Then use them in place of the standard ones.
But unless you have some custom data analysis tools setup, you probably won't get much out of the data. Google Analytics doesn't have event funnels AFAIR.

Is there a way to correlate a TCP connection with a process w/o root access

I'm reading packets in native code from the TUN interface created with the VpnService API. I would like to correlate packets to installed applications, i.e., to know which application sent a certain packet, without root access. With root access it would be a simple case of either using netstat/lsof or going through some of the /proc files. However, I couldn't find a way to get a list of connection <--> PID (or UID) mappings, neither in the native Linux context, nor within the higher level Android APIs.
I don't mind a more convoluted solution that needs work and is somewhat hackish, as long as it works without root access.
Looking forward to even ideas and starting points that I can further explore myself, if you don't have a full solution. And if you know 100% this is not possible, no matter the workarounds that I may try, let me know.
To answer my own question, in case someone finds this post with a search engine, yes it is possible, at least up to Android P, by reading the /proc/net/tcp, /proc/net/tcp6, /proc/net/udp, and /proc/net/udp6 files. However, in Android P the ability to read files under /proc/net is starting to be restricted (see this thread) and is going away in Android Q.

Categories

Resources