With approximately this code, I was able to establish an SHS connection with my phone.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4204 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-03-08 02:49:41 +00:00
parent 61ff466908
commit 9127a18ff0
5 changed files with 9 additions and 2 deletions

View File

@ -403,6 +403,9 @@ out/TildeFriends.apk: out/TildeFriends.unsigned.apk
@echo [apksigner] $(notdir $@)
@$(ANDROID_BUILD_TOOLS)/apksigner sign --ks keystore.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --out $@ $<
apk: out/TildeFriends.apk
.PHONY: apk
clean:
rm -rf $(BUILD_DIR)
.PHONY: clean

View File

@ -4,6 +4,7 @@
versionCode="1"
versionName="0.0.4">
<uses-sdk android:minSdkVersion="16"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="Tilde Friends">
<activity android:name=".MainActivity">
<intent-filter>

View File

@ -11,7 +11,9 @@ public class MainActivity extends Activity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView text = (TextView)findViewById(R.id.my_text);
Log.w("tildefriends", String.format("external files dir is %s", getFilesDir().toString()));
Log.w("tildefriends", String.format("getFilesDir() is %s", getFilesDir().toString()));
Log.w("tildefriends", String.format("getPackageResourcePath() is %s", getPackageResourcePath().toString()));
Log.w("tildefriends", String.format("getPackageCodePath() is %s", getPackageCodePath().toString()));
setFilesPath(getFilesDir().toString());
text.setText(getMessage());
}

View File

@ -362,6 +362,7 @@ static int _tf_run_task(const tf_run_args_t* args, int index)
result = 0;
}
tf_task_destroy(task);
tf_printf("_tf_run_task is done. Goodbye.\n");
return result;
}

View File

@ -2585,7 +2585,7 @@ static void _tf_ssb_send_broadcast(tf_ssb_t* ssb, struct sockaddr_in* address)
int r = uv_udp_try_send(&ssb->broadcast_sender, &buf, 1, (struct sockaddr*)&broadcast_addr);
if (r < 0)
{
tf_printf("failed to send broadcast %d: %s\n", r, uv_strerror(r));
tf_printf("failed to send broadcast for %s (%d): %s\n", address_str, r, uv_strerror(r));
}
}