I am writing an Android app for uni (semester project). The idea is to be able to compare music "taste" between nearby devices. Long story short it's somewhat similar to Last.fm, but the idea is to be able to do similar things but for nearby devices, and not people all around the world, just like being able to see what the person at the end of your bus is listening to (if they're using my app of course) - seeing the currently playing/last played song on your, preferably using the Android player's list of most played songs to get some sort of comparision, perhaps also somehow extracitng "Artists" from the default Android player. I have two general questions:
MAIN QUESTION Finding nearby devices & getting it's IDs. I don't need a huge range on that, Bluetooth would be enough for the needs of the project but the thing is most of the functionalities will be handled via database, all I need is finding nearby devices and getting the device's unique ID (as a String, preferably hashed from MAC and ANDROID_ID, since the latter doesn't guarantee it will be unique). What would be the optimal & fairly easy way to do it so that I can find the device and after clicking on it I'd get just the ID? I've figured almost everything else in the app out but I have honestly no idea how to approach this - even though it seems to do very little, but is also a key thing to make my app what it is.
SIDE QUESTION When it comes to the "Artists" tab in default player - is there a way to extract the list of all artists of the songs (and the amount of the songs by them) that I have on my phone? You can see the songs grouped by artists in the player, but I didn't find a way to do what I described. It's not a necessary feature I'd like to include in the app but it would definitely be great to just have like a general idea that someone has 7 songs by Metallica on their phone.
Thanks in advance for any help, espescially with the first issue, but I'll appreciate if someone has an idea how to achieve what I described in the side question as well!
Related
I'm trying to program an app using android studio that receives data (blood sugar levels) from the app tomato (which calculates blood sugar levels automatically every 5 mins or so). The tomato app already exists and is made by a company.
So I was wondering if doing this is possible. if so, how?
I saw this post: Is it possible for an Android app to use data from another app? which is very similar to what im trying to do but i didnt find an exact solution/answer to this.
Any opinions and help are very much needed and welcomed.
You would first need to know how the app is storing the data, you could check your phone's storage using the Device File Explorer in Android Studio. If they have exposed the data then you are able to check and read the files that the app has exposed. However, I have a feeling that they would not be leaving them in plain text for you to take.
Upon some further reading, it seems they read from a device called a MiaoMiao Transmitter. You could ask the producer of this product for a developer kit and see what they say. This would come with documentation as to how you can get data from the product. However, if they do not provide you with any help, you will need to do some investigation as to how the device functions.
Perhaps it sends android broadcasts when it is taking a reading? This is just speculation of course. This is very niche and I believe that is a reason there are only a few apps that use the device - they are trying to lock out "non-verified" developers. However, when there is a will, there is always a way! ;)
Best of luck!
Background
I've found an interesting article and github repository that shows that it's possible to let the Phone app to show caller-id information of people, during a phone call, so I'm wondering if that's the official way to do it, or something else.
This sample shows that in order to provide this data, you need to implement ContentProvider.
The problem
It seems to me almost like a hack, and seeing that it works on some (most?) devices, but not on Samsung devices.
It could be just that Samsung's own app doesn't use this data for some reason.
But there is another problem: If I make an app that serves another app to show caller-id data, it would be better to do it only for the currently default phone app, during a phone call.
I wouldn't want just any app to reach this data and fetch it all. Sadly, I don't see any way to use ContentProvider that will allow queries only for the current phone app. I could perhaps check if currently the device is during a phone call, but that's not much of a data protection...
What I've tried
Thing is, there is practically no information about this rare case over the Internet, no questions whatsoever. OK, there is this one, but it points to the same solution...
I searched a lot to even reach this article and repository.
The questions
Is this really the official way to provide data for the Phone app? If not, how should I do it? Would it work for all devices, including Samsung?
For data-protection, is there a way for ContentProvider to allow queering data only for specific apps, during runtime ? Meaning that for each query, I could check which app requests the query?
So wasn't sure how to title this one but I'm hoping someone with Android experience can answer this for me.
I'm trying to turn Android code into App Inventor 2 code. I need to start a new activity and have the relevant Action, ActivityPackage, ActivityClass, DataType, ExtraKey, ExtraValue (whether all of these are needed for this specific situation I'm not sure) to input into an ActivityStarter that views the locally stored phone contacts.
I am sure there is a way, there is in just Android app making with Java but I need help translating that code across. I'm pretty sure I want an android.intent.action.VIEW and contactsContract.CommonDataKindsPhone I'm just not sure in which parts in should go and what else I need to than be able to add that information to a list.
This is what I have so far:
I'm sure others would appreciate this information, as well as how to get other related data to contacts into App Inventor 2.
Also I know about ContactPicker.PhoneNumberList and PhoneNumberPicker.PhoneNumberList neither of which are able to find any contacts on my phone which is why I'm trying to work out a work-around.
Anyway any help is appreciated,
Thanks.
Unfortunately it's not possible to get a list of locally stored phone contacts with App Inventor. See also issue 734 in the Issues List. I suggest you to star this issue, so probably one day we get this feature into App Inventor.
The ContactPicker.PhoneNumberList or PhoneNumberPicker.PhoneNumberList only give you all phone numbers of a contact after picking a contact.
App Inventor has its limitations and unfortunately you can't do something like this as described in this Stackoverflow answer. The only thing you can do is to access the Google Contacts API with the web component to get a list of contacts, but precondition is, your contacts are synchronized with Google, but this is not what you want. An example to do that you can find here.
I am trying to develop an app/widget for which I need display the currently playing information (metadata) of an audio track.
This would be trivial if I was also writing the MediaPlayer myself, as I could simply access the MediaStore and bring up the info, however, I do not wish to compete with the plethora of existing apps on this front. I want to be able to pull this inforrmation from the builtin audio player or other app such as SongBird or PowerAMP.
I should be able to do this with PowerAMP using their [API][1], but have, but I really want a solution that works for the stock android player and others too.
I was hoping to be able to grab the information from the AudioManager, but that seems only to allow me to query the current state (Music is playing et) and I can set my intent to play music, etc... But no access to metadata from someone elses app.
So my thought is this cannot be done easily. My thoughts are that I could maybe access this info from the info bar at the top as the now playing info is printed up there. It might be an ugly hack though...
For a moment I got excited about the RemoteControlClient.MetadataEditor from 4.0, but then I figured out that it was for writing that information to a stream that can be sent to the physical remote, rather than allowing you to create a software remote. Damn!
Does anyone have any ideas?
[1]: http://forum.powerampapp.com/index.php?/topic/1034-updated-for-20-poweramp-api-lib-and-sample-applications/ Power AMP
I've written a guide for implementing this.
Basically, you need to have access to hidden classes of android.jar library. Then you have to extend IRemoteControlDisplay$Stub class, and implement it's methods.
After that you register your RemoteControlDisplay with hidden method - AudioManager#registerRemoteControlDisplay.
There is just way too much to explain in one answer, so read my guide on XDA-Developers.
Here is the link:
http://forum.xda-developers.com/showpost.php?p=44513199
Also, I'm currently working on a library which will simplify the process of implementing you remote media controls.
I should be able to do this with PowerAMP using their [API][1], but have, but I really want a solution that works for the stock android player and others too.
There is no documented and supported API for the AOSP Music app or the Google Play Music app, AFAIK. They certainly are not in the Android SDK.
I am not aware of an Android ecosystem standard for media players exposing this information, let alone a roster of apps that support such a standard. You are welcome to work with the developers of such apps and encourage them to create and adopt a standard.
My thoughts are that I could maybe access this info from the info bar at the top as the now playing info is printed up there.
It is not possible to spy on other applications' Notifications, for obvious privacy and security reasons.
For a moment I got excited about the RemoteControlClient.MetadataEditor from 4.0, but then I figured out that it was for writing that information to a stream that can be sent to the physical remote, rather than allowing you to create a software remote. Damn!
Surely there's a way to access the Remote Control Client metadata on Android 4.0, because the lock screen is able to access it when media is playing.
I'm not a developer at all, but I've tried to do a bit of poking around in the AOKP sources and this is my limited understanding of how it works. At least in AOKP (and presumably AOSP as well, then), it appears that the lockscreen uses core/java/com/android/internal/widget/TransportControlView.java to draw the music control widget on the lockscreen, which in turn uses media/java/android/media/IRemoteControlDisplay.aidl for data retrieval. At the very least, it may be useful to poke around in TransportControlView.java to see if you can figure out how the lockscreen widget works.
I'm looking at developing an app that could benefit from having a image recognition system. I've seen this sort of thing in iPhone and Android apps. Take a picture of a book and the app takes you to Amazon where you can find that book. I'm not looking for general image recognition, but more the ability to pick a single image out of a library of about 10k images.
Any ideas of what services are available for this sort of thing?
Google Goggles does something similar to Amazon Remembers. It uses OCR if text can be identified and they want to use it with the similar image search from Google Images. I think they generate some kind of hash for an image with the feature that if the images are similar the images are similar to.
My best guess would be try to start with the character recognition and do a text search for the title of your card. This means your user has to make a very clear image maybe even in a specific position. But for a first application this would be great already. As somebody playing magic I would buy the tool for trading and cataloging my cards.
Actually, while short of getting an actual Amazon employee to tell you there is no way to confirm this, I am fairly certain that the Amazon Remembers feature you refer to is actually the work of crowd sourcing- using lots of people combing through data to make it appear like a computer is doing it. I think they may actually be using there own Mechanical Turk system.
Edit: Also, I found this SO question that might interest you. It is specifically for playing cards, but some of the answers (such as the machine learning example) can be modified to be more helpful for what you want to do with magic cards.