Android Studio and Bluetooth---mission impossible - android

I am trying to put together a little phone app that will take characters from an ExitText and send them out via Bluetooth.
Getting Bluetooth to work seems to have become an impossible task. I have used Bluetooth before with other SDKs and it was simple. I want to replace a program I wrote years ago using VB5 and Bluetooth. It was simple and I had it working in a few hours. With Android Studio I can't seem to find any simple way of using Bluetooth.
Not that there aren't any examples. In fact there are TOO MANY examples. Most seem to be for obsolete versions of Android Studio or have other problems making them impossible to implement in 3.2.1. When I try, get so many errors I know I will never be able to correct them. Others don't throw errors but nothing happens. I don't know what all the code should do so debugging it is impossible. Over the last week or so I have tried 7 different "examples" (as reported by Android Studio "recent" list) and can't get any of them to run.
I did find an example that says it does something similar to what I want. It contains over 300 lines of code! Does that seem realistic?
I guess what I am asking is, can somebody point me in the right direction? Somewhere that I can see an explanation of what is needed and how to create it?
Sorry if this sounds like a rant but in many ways it is.
Things I have tried and that came close to working but don't:
BluetoothChat.
BluetoothhTutorial
SimpleBluetooth
and How to send/receive messages via bluetooth android studio
Thanks
Pete

Related

How to create a tv tuner library for android?

I have a K1 Plus android box which have a built-in dvb-t2` and dvb-s2 tuner in it. I want to create an app that gets and shows the channels from those tuners.
At first, I found about android's TV Input Framework(TIF). The sample app keeps crashing by calling a method that gets the available inputs of the device. Then, found out that it only work for real Android TVs. I looked for android libraries for that android box but didn't find anything. I looked for c libraries that can access the tuners but didn't find anything as well. I looked for code on how to access the hardware components of an android device and didn't find anything. I recently found about https://opencv.org/. I haven't read everything about it yet so I don't really know how to use it.
I found about https://git.linuxtv.org/v4l-utils.git from an answer to a SO question but it seems like it can only be used after installing it to an OS. I was able to compile it using CMake on android but it got missing header files.
I also found http://android4tv.iwedia.com. Unfortunately, it's also using TIF.
I'm trying to create something like kodi but I found out that it isn't really the one that gets the channels but kodi is getting it from a supported iptv box. I have zero knowledge about writing C but I'll try to make the code.
This is the box btw. http://www.videostrong.com/S905D+DVB(KI%20PLUS)/55.html
From my research, I found about HAL(Hardware Abstraction Layer). Do I need that for making my C code?
Update:
After months of research and not finding any quick way to implement a tv tuner library, I returned to my bookmarks from previous research. One of them is this. The first step from that SO answer is do a ls /dev/dvb/ on the device. Because I need to do it on the android box itself, I researched about android terminal apps and found Termux. Then I did the ls /dev/dvb/ command on Termux and it told that the resource was not found or it did not exist. Then I tried to just do a ls /dev/ command and luckily I got results. There's quite a lot of them and I found something related to dvb.
The dvb related results were:
dvb0.demux0
dvb0.demux1
dvb0.demux2
dvb0.dsc0
dvb0.dsc1
dvb0.dvr0
dvb0.dvr1
dvb0.dvr2
dvb0.net0
dvb0.net1
dvb0.net2
I can post the whole list but I'll post this more related (I think) results.
The results are quite different than the example of the link above because they only used dvb and not dvb0.
UPDATE:
I might use a usb tv tuner now based on a suggestion to me.
UPDATE:
Is there a list of standard and tv tuner related usb byte[] commands that I can look at? I already saw some but they are mostly for FTDI, serial or the really standard commands which I don't have really have any use.
It will probably take a lot of reverse engineering or a leaked documentation to achieve what you are trying to do.
Devices like the one you are working on usually use proprietery hardware with proprietery drivers for things like DVB, so making a third party app for a TV tuner is very hard.
First, you need to find out what kind of DVB chip / card this Android box has.
Then, you need to figure out how (on what kind of BUS) it is connected to the system.
If it is something generic, you may be able to talk to its driver, if not, you would need to write your own driver.
This is too complicated to explain in a SO post, but you could start by opening the box and looking at the components or by running commands like lsusb through ADB to try and identify the DVB component.
If the device already has a DVB app, you could try disassembling it, to find out how it works.
Good luck!

Getting an App APK

Hey guys and girls for a the past week I've grown a lot of interest in android studio (even without knowing quite much about it) I decided to create an app that I deemed quite useful. However the app required maps to be integrated in it and I really did not know what I was doing and at one point I started messing with the settings and then all hell broke loose and I kept getting AAPT2 errors and I even tried to fix this issue with the gradle properties line that you add (I forgot the line of code to add). Anyways it still didnt work. However I rembered that I always kept the good version (before I broke everything) of the app on my phone. So when I go in my phone the app is there and it works just fine. Ive tried so many things to get the source code from the app on my phone without any succes. My question is, how can I get the source code back from the working app onto my laptop to continue coding in android studio? If it helps I am using Linux 18.04 LTS and running the newest version of android studio. Thank you for any help from you guys. This means a lot to me.
You can’t get back the ‘source code’ from an already compiled app.
You should consider using some version control platforms like git from the next time

How to build and run Android-Eye

Lately, while attempting to build an interesting open source android-web streamer: Android-Eye, I noticed that several people, including myself have been stumped by process of building the application given that it contains c/c++ code that (I think) needs to be compiled by the android ndk before anything can work. The fact that the dev doesn't seem to be active anymore doesn't make this any easier.
I've been trying to get this to work for well over 3 days now and can say with full confidence that I do not posses the knowledge (especially for the ndk) to get this thing built. The long list of things i've tried is too extensive to be covered in this post but here are a few git issues posted by others that have experienced similar issues as me:
https://github.com/Teaonly/android-eye/issues/32
https://github.com/Teaonly/android-eye/issues/27
I understand that it may look as if I am asking to be "spoonfed" the process of building the application but a few pushes in the right direction would be excellent :)
BTW, I have access to windows and mac boxes incase that influences the build process.
Thanks

Many many issues, eclipse, android MediaPlayer, etc

I've recently started android programming, and I'm extremely frustrated to say the least with a lot of things that to me seem simple but are totally holding me back from making any progress. The first of which is the "my first app" hello world that I started a tutorial from http://developer.android.com/training/basics/firstapp/creating-project.html
This tutorial worked fine when I was originally looking into android a while ago. Then when I came back after learning a bunch of java this program will no longer work unless I change the target-sdk to version 10 (I found that solution after extensive searching on this site).
Then I moved on to starting tutorials by thenewboston
All of these work fine as long as I didn't use any new targetsdkversion, so I'm wondering what happened that everywhere I go looking for tutorials I can't find anything that will actually work on the current ADT(4.4W and L are what my eclipse automatically set up) and eclipse (indigo). I'll also get issues saying lint isn't working, or trouble with android SDK content loader when I'm not even doing anything.
I've also found snippets of code example on the developer website that I linked earlier that don't work when implemented either
So, am I missing something, is that just old documentation, or is something up with eclipse and ADT? I'm just so frustrated that everything wants to bug out on me when I'm just trying to follow simple introductory tutorials and I don't even know where to turn for tutorials that I can trust to work..
edit:removed code because it wasn't needed.
To not get blocked What you can do is continue to set "targetVersion as '19'" instead of setting it to 20 or so. Ensure that you've downloaded API19 through SDK Manager and create the AVDs with that targetSDK version for checking you apps.
That way you can proceed ahead with your coding and later when things get resolved by google for API20...you can always comeback to that new version. This way you can follow 'TheNewBoston' and start coding in Android.
I also recommend 'Slidenerd' tutorials over youtube as well for the beginner.
BTW, I've also selected 'Blank Activity / Empty Activity" during the project creation with API19 and been able to move ahead with my coding.
The Google Bug thread about this latest version issue can be tracked here : The google bug
As a beginning developer, I suggest you use API 19. It has been out for a while and is more stable than L or Google Wear.

Can IDEA's logcat filter automatically recognize running app?

Either I am unable to find this or IDEA still hasn't implemented the smart filter like Eclipse did long time ago.
When I am looking at logcat tab in IDEA 11, I do not see that it automatically recognizes running app and adds it under All Messages, just like Eclise does for each runnung app.
Am I missing something?
I saw that they added "Improved Filtering" feature a year ago (link), but I still haven't found a good use of it. Have you?
This feature is not available yet. I've added a new feature request, feel free to vote.

Categories

Resources