Android Things RC522 (Galarzaa90 library) - android

I can't seem to get Galarzaa's library to work.
Neither his example nor the code under "usage" on the front page compiles.
The following line (and every consecutive call on rc522 from the "usage" section) causes a problem:
boolean result = rc522.authenticateCard(Rc522.AUTH_A, block, key);
Does any one know a tutorial or any helpfull link?
Also, do I have to configure the GPIO Pins of my build when I create it from the Android Things console under Step 5 Edit hardware configurations? If so, where do I find all the neccessary information? Or can I completly ignore that part, as long as my RC522 reader is properly connected to the RPi

I did got it to work following the example. I don't recall anything wrong with the documentation, but I'll double check.
I think you are trying a very complicated method for deploying. You are supposed to use the console and the custom images when you are done developing and want to do distribution. While in development, you should use a default image and Deploy the apk using adb.

Related

Any way to see all the methods that don't work at once? Android Studio

I have to estimate the time it takes to update a specific application made for Android 4.4 to Android 10 and I need to see all the methods that are deprecated or not working. Is there any way to see the methods without going file by file? (I'm using Android Studio with Java)
When I build the application I only get one or two types of error at a time, when I correct them I get another one and so on.
Thanks and best regards.
P.S: How long does it take you to update something like that? I'm a junior and I'm a little lost doing this.
Here, go to Analyze -> Inspect code. After inspecting check maturity there you will have depreciated methods. (Don't forget to change minSdk)
After you will do that it give you method with a warning and you can filter it by having API not support warning

atrace events: how to make them visible in systrace?

Good day everyone!
I am pretty new to android profiling. And recently I have found, that systrace from google sdk call atrace. I also found that there is a set of functions from libcutils, which one could use for creating atrace events and in such a way profile, for example, c++ code.
I`ve found headers, made a dynamic loading with libcutils.so and after including everything build my lib and integrate it in apk. After it I install it on the phone and try to profile with systrace.py, but i could not find any call in systrace log to my created event.
I try to place Artace_begin(name)/Atrace_end() in different places, but still nothing changes.
So may be someone could help me, please, how to make it properly working and detect atrace event in systrace log?

Error while saving a standalone application

I have reached a problem in the final stages of completing my stack. I have been working on this project for a couple months now and it is finally complete. The aim of the app is for you (as the user) to be able to have a type of calculator which performs a certain sequence of sums once a numerical value is entered. It is now finished (thank goodness! :P) but I have reached an error whilst saving this app. I am saving it as an Android application (.apk) for use on a mobile phone. I have the Android personal 1 pack, and my error is as follows:
There was an error while saving the standalone application could not compile application class
I am unsure as to why this is occurring but find it hard to believe that this could have occurred because of either invalid syntax or that a command I was using was incompatible with Android.
As I said before my stack is very simple and only performs a few basic mathematical functions (mainly multiplying contents of fields) by each other. If you wish to see this script, please request.
#ninjabunny14 yep it's a good idea to include code, actual text of error messages, details of the platform you're developing on, versions of LiveCode/Android etc
In the meantime you could Google "error while saving the standalone application could not compile application class" like I've just done and found quite a few links to LiveCode forum threads (like this one http://forums.runrev.com/phpBB2/viewtopic.php?f=53&t=12330) which look like they might be of use...
NinjaBunny,
This sounds more like an error from the Android SDK than a LiveCode error. For starters check these things in the Android settings pane in the LiveCode Standalone Applications Settings:
Identifier: It has to be unique to this application. If you've ever done a test build for Android without changing this default identifier you will get an error.
Signing: Unless you have a key, choose Sign for development only or Don't sign.
Minimum Android version: make sure you have all of the packages needed for your target version in your Android SDK.
Go to Edit/Preferences and set up the Android SDK path, which is probably empty in your case:
I had this a few times because it is easy to forget.
The identifier in the android settings does not like characters like - so do not use a name like com.itis-me.myapp , but use com.itisme.myapp
the use of a character like - gives you this error.

How do you debug successfully in Android?

I understand there is the LogCat view to check the messages logged but I can't make sense of it.
When debugging (I use Java primarily) I've been accustomed to stepping over each line of code and finding out the exact point where the program crashes and then doing something about it.
How can I do this with Android development? Is there a way to precisely locate the line which is causing the application to crash?
I can't understand what to make of/how to read the LogCat messages and when I try to step over (using the F9 key or the 'Debug' option in Eclipse) it keeps opening new tabs for inbuilt classfiles (like Instrumentation.class etc) and after pressing F6 a few times over again the app crashes showing 'The application has stopped unexpectedly. Please try again'
Can someone tell me if there's something to be done in a way that I'm not doing here?
Thanks!
Btw if it helps, here's the generated log:
http://pastebin.com/EaqaWUdS
You are using a resource id that doesn't exist at line : 93 of com.site.custom.ModAdapter.getView(CustomListProjectActivity.java
--EDIT : add explanations
You will read a logcat stack trace in the same way as you did in Java : read bottom up and the culprit is the last line of your classes (before the code gets into the android sdk code).
You can do it the other way around, and start from top, stopping at the first class of yours and discarding android classes.
The same reasoning applies when debugging : step into your methods if needed and step over all methods of the SDK unless you want to debug them (and usually you don't, if you really suspect a bug inside the SDK, check the source at grepcode to see the inner mechanics of the android sdk class you are interested in).
Sometimes it gets difficult to track bugs on android, especially for widget layout related bugs because you can only see the code that is executed by the android platform, no code of your is executed, only your data are read from an xml file for instance. If something breaks here, it can be harder to debug. In that case, apply the dichotomy method : remove half line, if the bug doesn't show up, then readd your lines, remove half of them, etc...
It is the same like in java. Basically you need the sources to open the java files instead the class files. Google shows you how to add the sources.
Basically you debug android while staying in your own classes. I barely look into the android classes as the most issues are, of course, located in my own classes.
So just debug like you already do but don't step into methods/classes you don't own unless you have the sources added to your sdk. Even if you have, there might be some classes that aren't open source, so you can't step into the sources there. (Basically all Google API classes)

MapView doesn't display tiles - debugging strategies?

There are a number of posts (both here & elsewhere) about why a MapView might not be displaying tile info (personally, I've liked Android "Hello, MapView" Tutorial - Map Tiles Do Not Load, but there are other good ones, too).
My question is slightly different: I'm not getting tile info to show up (on my handset or in the emulator), and I'm looking for advice on what to try in order to debug this problem. As far as I can tell I've correctly located my debug.keystore, and used the Java JDK keytool to get the signature from it, which I then plugged into the Google web page, and then plugged THAT key back into my XML file. The app runs ok, it just doesn't display any tiles.
I was hoping that if I did something wrong here I'd see an error message in, say, logcat (or an exception that Eclipse might catch) that would confirm that this is the source of the error.
So here's my question - what would y'all recommend someone try in order to figure out what the actual problem is?
Step #1: See if the built in Maps application works. If it does not, you have problems with the device.
Step #2: Triple-check that you have the INTERNET permission correctly defined.
Step #3: Triple-check that you have a proper API key.
Step #4: Return to Step #1. :-)
I have many sample Maps applications scattered throughout my books -- here is the simplest one.

Categories

Resources