java.net.SocketException: socket failed: EACCES (Permission denied)

App.manifests.Androidmanifest.xml

error:
java.net.SocketException: socket failed: EACCES (Permission denied)

solve:
add : Manifest.xml file

<uses-permissionandroid:name="android.permission.INTERNET"


example:

<?xmlversion="1.0"encoding="utf-8"?>
<manifestxmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.androidclient">

<uses-permissionandroid:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activityandroid:name=".MainActivity">
<intent-filter>
<actionandroid:name="android.intent.action.MAIN"/>

<categoryandroid:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>

</manifest>



#Android #Java #Permission denied

pure virtual function call (C/C++)

armv7 toolchain Error

error message:
pure virtual function call

solve:
1. Occurs when calling a virtual function from a constructor or destructor.
2. Compiler option did not write -march==armv7-a.

example :
arm-linux-gnueabi-g++ -fno-omit-frame-pointer -march=armv7-a -funwind-tables

#toolchain #embedded #C #C++

Terminate called out an active extension / Aborted (C/C++)


You can build it, but when you run it,
Execute and die when an error occurs.

Error Message:
Terminate called out an active extension
Aborted


Problem
Occurs when coding using "std::thread"

Cause / Solution
When coding using "std::thread", it is caused by not inserting "join"


Example Code:
class TEST {
TEST();
~TEST();

void init();
void end();
std::shared_ptr<std::thread> th = nullptr;

void exec(){}
}

void TEST::init() {
    th = std::make_shared<std::thread>(&TEST::exec , this);
}
void TEST::end() {
if(th != nullptr) {
th->join();
th = nullptr;
}
}

int main() {
Test *t = new TEST();
t->init();

if( t != nullptr ) {
delete t;
t = nullptr;
}
// If this program ends here, an error will occur.

//add code
t->end();
if( t != nullptr ) {
delete t;
t = nullptr;
}
//solved code !
}




#linux #embedded #C #C++ #debug #error #thread #join

wstring to string / string to wstring / utf16 to utf8 / utf8 to utf16(C/C++)

wstring to string / string to wstring

for utf16 parsing error


#include <locale>
#include <codecvt>
#include <string>

std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
std::string Str_UTF8 = converter.to_bytes(utf16String);
std::wstring wideString_UTF16 = converter.from_bytes(utf8String);

For use, you should modify the bold writing.

#utf16 #utf8 #wstring #string #C #C++ #Embedded #Linux

알뜰폰 삼성페이 교통카드 '한도 초과' 오류(등록 불가 오류) 해결방법

sk7mobile 알뜰폰 삼성페이 교통카드 등록 시, 한도 초과 문제 해결방법 skt usim 해킹 사건으로 인해 sk7mobile 알뜰폰을 사용하는 저도 usim을 바꾸고 나니 삼성페이 교통카드가 등록이 안되더라구요...  삼성페이 교통카드 기능 은...