I am working on a project with arduino, i am using NearBus connect my arduino to cloud. I am using api downloaded from NearBus but when i load it an compile it says "NearbusEther_v16.h: No such file or directory" although file is available in libraries folder.
Please help.
Have you used
#include "NearbusEther_v16.h"
or
#include <NearbusEther_v16.h>
?
There is a difference. Also did you try manually adding the file through the Sketch>Add File dialog?
Related
I solve the problem.
#include <QtCore/private/qandroidextras_p.h>
The private folder is not included in the qtcore folder.
private folder is included in the "6.4.2(qt version)" folder. you have to copy the private folder to first QtCore folder.
and if you include "QtCore/private/qandroidextras_p.h", it will succeed.
and Refer to this article and request for permission, and it will succeed.
Requesting Android permissions in Qt 6
I hope this article will be helpful to others.
I solved the probelm.
The QtAndroid.h file has been replaced with qandroidextras_p.h on 6.2
https://doc.qt.io/qt-6/qtandroidprivate.html#requestPermission-1
we have to include header file, like this
#include <6.4.2(qt version)/QtCore/private/qandroidextras_p.h>
But when I include this header file, on Error message, it can't find the included header file in the qandroidextras_p.h file. This part seems to need to edit the included header file path of the qandroidextras_p.h file.
I succeeded in getting file permissions.
There is header file
#include <QtCore/private/qandroidextras_p.h>
I have to copy the private(QtCore/6.4.2/QtCore/[private]/qandroidextras_p.h) folder to first QtCore folder.
if you don't copy this folder, compiler can't find the some header files that declared on qandroidextras_p.h file.
and add the permission on AndroidManifest.xml file
Request Permission function
Requesting Android permissions in Qt 6
Create Android Manifest file
Where did the "Create AndroidManifest.xml" button go in Qt Creator 3.3.0?
Search file on qt
Recursively iterate over all the files in a directory and its subdirectories in Qt
when search files on android, root path is must be '/storage/emulated/0;' or '/mnt/sdcard'. not the QDir::rootPath();
I never make a android project and i don't know java. I am trying to port my c++ sdl opengl project to android. I am using android studio. I opened sdl sample android project and now i can manage project from main.cpp . How do i know this because I changed the color of the window and it worked. But when i try to load shader.text file with ifstream program crashed. I understand that this will not happen. After this i searched but I couldn't find a complete code or an example.
When i put files in assets folder and build apk. apk size grows as files. Therefore I need to kepth files in assets folder ?
I think i need to use asset manager but of course i don't know.
What files should I write what code? I mean what i need to add main.cpp and I need to add code java side also ?
main.cpp :
int main()
{
//lets say i have filePath like these
char file_vert[100];
snprintf(file_vert,100,"shaders/vertexShader.text");
char file_Texture[100];
snprintf(file_Texture,100,"textures/image.jpg");
//i am using them in cpp project
//shader text file like this
std::ifstream vShaderFile;
vShaderFile.open(file_vert);
//and i am loading texture file with "stbi" library
unsigned char *data = stbi_load(file_Texture, &width, &height, &nrComponents, 0);
}
I wrote a script that allows you to read and write to a json file. As long as I tried the script in unity editor, I didn't have any problems. But when I switched to installing the application on an Android device, I can't find my json file.
The json file is called "playerData.json" and has been placed in a folder called "playerData.json".
This is the code for the path of the json file (working on unity but not working on android)
path = Application.streamingAssetsPath + "/playerData.json";
I tried using this string of code to get the code to work on android as well, but there is no way to get it to work.
path = System.IO.Path.Combine(Application.streamingAssetsPath, "/playerData.json");
I only wrote the line concerning the path as my android device cannot find the JSON file. Thanks everyone for the help!
Application.streamingAssetsPath does not work on Android and WebGL
It is not possible to access the StreamingAssets folder on WebGL and Android platforms. No file access is available on WebGL. Android uses a compressed .apk file. These platforms return a URL. Use the UnityWebRequest class to access the Assets.
There is a workaround though as mentioned using UnityWebRequest, can find an example in this Unity Answer
I have an Android application that use JNI. In JNI I used C++ STL library to output some data into a text file.
This is the snippet code.
#include <iostream>
#include <fstream>
float mydata[4] = {0.0f};
ofstream file;
file.open("Data.txt", ios::app);
// For example
file<<mydata[1];
file.close();
when I ran ndk-build, I did not face any errors and the program seems run properly. But I did not found any text file in my Application directory.
does anybody know what could be the issue? Please help.
Thanks
Your code works, but you apparently try to access a path which is forbidden.
Firstly, be sure that your Android application asks for storage permissions.
Secondly, try to replace "Data" by an absolute path you know you have access to (e.g. "/sdcard/Pictures/Data.txt").
Also, as a better practice, you should test if the file has been opened before writing to it.
I am trying to port libtiff on Android. The source version I am using is tiff 4.0.1.
I am building this source inside u1 android OS.
I am getting the below error when I run mmm external/tiff 4.0.1/
In file included from external/tiff-4.0.1/libtiff/tiffiop.h:33,
from external/tiff-4.0.1/libtiff/tif_dirread.c:42:
external/tiff-4.0.1/libtiff/tif_config.h:93:1: warning: "HAVE_MALLOC_H" redefined
In file included from <command-line>:0:
./system/core/include/arch/linux-arm/AndroidConfig.h:221:1: warning: this is the location of the previous definition
In file included from external/tiff-4.0.1/libtiff/tif_dirread.c:42:
external/tiff-4.0.1/libtiff/tiffiop.h:54:21: error: search.h: No such file or directory
I tries searching a lot on internet but could not get the issue.
Can any one provide me just an approx idea what could be wrong or which package is missing.
I resolved this issue finally. I hope this will help someone who is doing this work in future. We just need to remove the lines from libtiff/tiffiop.h where header file is being referenced.That worked for me.
Depending on your libtiff version, you can also just undefine HAVE_SEARCH_H in the config file tif_config.h which will then no longer include <search.h>:
In tif_config.h:
#ifndef ANDROID
/* Define to 1 if you have the <search.h> header file. */
#define HAVE_SEARCH_H 1
#endif