↧
Comment by vesperto on Android Broadcast Receiver not starting (Kotlin)
Deprecated in favor of...?
View ArticleComment by vesperto on How to generate a QR Code for an Android application?
IF you're generating a QR code for a thermal printer, use Bitmap.Config.ARGB_8888.
View ArticleComment by vesperto on How can I bind serversocket to specific IP?
Using "127.0.0.1" will still spawn an IPv6 server as shown by netstat -letW in adb shell.
View ArticleComment by vesperto on Why does my service always bind to ipv6 localhost...
using server = ServerSocket(8080, 8, InetAddress.getByName("127.0.0.1")) on the device i tried with Android 11 still produces an IPv6 server as shown by netstat -lte (and not a tcp46 connection as seen...
View ArticleComment by vesperto on Android UDP socket sends data only once?
It's a Michelle Dubois socket.
View ArticleComment by vesperto on convert a char* to std::string
Weird how std::to_string() will accept just about any tipe... except char*.
View ArticleComment by vesperto on Makefile that distinguishes between Windows and...
If using cygwin or in a mingw shell, you'd have rm in path and still be in windows.
View ArticleComment by vesperto on Cross compile libcurl for arm-linux-gnueabi-gcc
Where do you get the --host= parameter value from?
View ArticleComment by vesperto on keeping file across android app uninstall/reinstall
@blackapps source for that? It's marked deprecated in the docs.
View ArticleComment by vesperto on Alternatives to gettext?
@gili how often do you actually need to "maintain" such a stable tool in such a stable context? Lastest release february 2024.
View ArticleHow to set character set using ESC/POS?
More specifically, what is the difference between ESC t and ESC R and when should i use them?How does it tie with the character encoding of the byte arrays i may send to the printer?EditAs a...
View ArticleProgram segfaulting in release version only
I have an executable that is segfaulting in release but not in debug. I assume it's a wrong call to a printf-family function.When running i get this:*** buffer overflow detected ***: ./mybin...
View ArticleAnswer by vesperto for Program segfaulting in release version only
Well, as it turns out, the original text (not "Some text") took 19 chars plus the %d, which is "always" one digit. Even so, that's 20 chars in a char aCharArr[20], producing a char array that is not...
View ArticleAnswer by vesperto for GLib.Error: Required gtk+ version 3.20, current...
I've since got it to work on Xenial, but the app doesn't work correctly: the File, Edit, ... menu options don't work, for instance.From my ever-growing notes, i got it to work by compiling...
View ArticleGLib.Error: Required gtk+ version 3.20, current version is 3.18 (7)
I have an old program written in Python2 i need to use, but it's not getting along with Ubuntu Xenial's dependencies.I had to manually fetch these in order to get it to...
View Articleupgrading GTK from 3.18 to 3.20 in msys for python 2
I managed to get an old Python 2 app running on Xenial, but the menus aren't working and i've since borked that particular installation (can be recovered i guess). I was told this "used to work in a...
View ArticleSame expression as the destination warning when using snprintf
(I've seen questions 19202368, 40095973 and 1775403)I have this:char data[32];memset(data, '\0', sizeof(data));snprintf(data, sizeof(data), "%s - %d", aCharArray != NULL ? aCharArray : "", anInt);which...
View ArticleHow to print QR code (or bitmap) to thermal printer?
I'm working with software that runs on linux/windows and also android.On linux and windows, it prints QR codes by generating a bitmap and sending via ESC * to serial thermal printers.On android it uses...
View ArticleAnswer by vesperto for How do I get last commit date from git repository?
Late to the party but here's how to get the UNIX timestamp of the latest remote commit:git log -1 --date=raw origin/master | grep ^Date | tr -s '' | cut -d '' -f2
View ArticleAnswer by vesperto for SIGILL in Android NDK code
(I know it's answered but this is the first result i get when searching for NDK SIGILL ARM.)At least on ARM 32 bits devices (i think it's an architecture thing and not dependent on clang flags or the...
View ArticleAnswer by vesperto for C SDL2 Error: No hardware accelerated renderers available
You haveUint32 rflags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC;SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, rflags);Your error states No hardware accelerated renderers...
View ArticleAnswer by vesperto for MinGW won't compile, Error 1
Yes, it's an old question. These are some solutions i came across (YMMV a lot):Check if your paths start with c:/ as opposed to /c/ or vice-versa.Check if you're running in the right shell, i.e., one...
View ArticleAnswer by vesperto for script fails to launch application with desktop...
I still need extra steps to cross-compile on Fossa, but i figured out the issue.I have this in user pi's ~/.bashrc:export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/mylibsMy application depends on an...
View Articlescript fails to launch application with desktop shortcut on boot but works in...
I'm trying to start a C headless application when the Raspberry Pi boots and logs in to the Desktop, under the default user pi. The raspberry's a 3 B+ running Raspberry OS Buster.This is the desktop...
View ArticleAnswer by vesperto for complete SDL 1.2 documentation?
This is an archive of the old API wiki.As for SDL_RWops it's something like:SDL_RWops rw;rw = SDL_RWFromFile("/path/to/filename", "rb"); // rb being modeIt seems to retain the same signature in SDL2.
View ArticleAnswer by vesperto for How to fix 0xc000007b error which occurs in Visual...
While 0xc000007b means you're mixing 32/64 bits, it can also sometimes be thrown at you when the problem is indeed that you're missing a dependency (.dll, should be 0xc0000139). Dependencies can help...
View ArticleAlternative to the deprecated FileObserver constructor for API level
According to the documentation, both FileObserver(path: String!) and FileObserver(path: String!, mask: Int) are deprecated (I don't know when). However, all other constructors were only added in API 29...
View ArticleAnswer by vesperto for pacman -Syuu : error: failed retrieving file...
The MinGW FAQ covers the case when your company MitMs TLS/SSL certificates:extract the certificate of https://repo.msys2.org from your browserplace it in /etc/pki/ca-trust/source/anchorsrun...
View ArticleAnswer by vesperto for Error Undefined reference to...
I had a similar problem but had only changed source code, not the toolchain.I started getting/home/myuser/Android/Sdk/ndk/22.0.7026061/sources/cxx-stl/llvm-libc++/include/__locale:887:44: error:...
View ArticleAnswer by vesperto for Gradle sync failed: Plugin [id:...
This fixed it for me as my company thinks it's cute to use their own certificates as a MitM.After adding the certificate in File - Settings - Tools - Server Certificates, add something similar to this...
View ArticleAnswer by vesperto for Converting code from Java to Kotlin in Android Studio
If you just want to convert a code block and not a whole file, see this answer (TL;DR using a Java scratch file let's your code be interpreted as such by the IDE and when pasting will trigger the Do...
View ArticleWhat's the oldest SDK i can target on Android?
I currently have this in my build.gradle:android { defaultConfig { minSdkVersion 19 targetSdkVersion 21which translates into <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="21" />...
View ArticleAnswer by vesperto for Getting OS version with NDK in C
#if defined(__linux__)// Linux-based OS#if defined(__ANDROID__)// Android OS#else// other Linux-based OS#endif#endifSee this for reference. The caveat is that any linux system sets __linux__, and...
View ArticleAnswer by vesperto for Using Socket() in Android NDK
For reference, this should help debug the error:errno = 0;int client_fd = socket(AF_INET, SOCK_STREAM, 0);if (client_fd < 0){ printf("error opening socket: %s", strerror(errno)); return -1;}
View ArticleBitmap printing ESC/POS commands in 2021
The software i'm maintaining has been churning along printing bitmaps via ESC *.Recently i had to make some upgrades on another component and ended up using GS v 0.I find ESC * to be convoluted and...
View ArticleAnswer by vesperto for keeping file across android app uninstall/reinstall
Since getExternalStorageDirectory() is no longer deprecated i'm using that instead of hardcoded /sdcard.getExternalStoragePublicDirectory(String) keeps returning the same as...
View ArticleAnswer by vesperto for How to see what options my php was configured with?
You can use:php -i | grep configure
View ArticleAnswer by vesperto for Cross platform bluetooth development solutions
Qt Bluetooth seems quite promising in that it supports Android, iOS, Linux, macOS and Windows.
View ArticleAnswer by vesperto for CRTSCTS not define when compiling as C99
You can use -D_DEFAULT_SOURCE -std=c99 instead of -std=gnu99, at least in gentoo. It "seems more standard" to me.Searching around in /usr/include, I see:/usr/include/features.h 52 _DEFAULT_SOURCE The...
View Article
More Pages to Explore .....