I am using Gson to serialize/deserialize my pojos and currently looking for a clean way to tell Gson to parse/output date attributes as unix-timestamps. Here’s my attempt: Comming from PHP where “U” is the dateformat used to serialize/deserialize date as unix-timestamps, when running my atte…
Tag: android
RSA Encryption disparity between Android and Java environments
Firstly, apologies for the amount of code I’m about to post. I’m trying to use the RSA public key from my Java application to encrypt a message in an Android app, and then send the ciphertext back to a Java environment for decryption, but upon attempting to decrypt I always get this error: The cip…
How to connect to java server (socket) using internet
I’d read a tutorial from here. It is chat application made using java for server side and client as well and android as client. Its running good without any error just need to connect on ip address of server but my question is, can i use it over internet as well as over wifi? if yes then how? Answer Jus…
Set Android Custom Font on Tab Title
I am trying to set a custom font to the titles (“Tab Item 1”, “Tab Item 2”, “Tab Item 3”) from the code below. I am really new to Android Studio and Java and am just learning by doing and kind materials that has been over the internet. Assuming I have a font named “ab…
SimpleDateFormat returns wrong number of days
I need to get the number days, hours, minutes, seconds from a long value. But I am getting wrong number of days from a following code. When I pass 106988550 and “dd:HH:mm:ss” to this method, I am getting “02:05:43:08” Expected actual answer is : “01:05:43:08”. I don’t…
How to set sourceCompatability to javaVersion.VERSION_1_8
I installed jdk1.8.0_112 and write code below in build.gradle i received this error Can anyone help me? Answer from https://developer.android.com/guide/platform/j8-jack.html, you also need following: UPDATE Note that Jack toolchain is now deprecated https://android-developers.googleblog.com/2017/03/future-of-…
How to underline an EditText
I am having some problems to underline an EditText in AndroidStudio. This is what I am looking for (this is just a photo, not my real text): But I do not really know any property to do that. My code …
IntentService is freezing my application UI
In my application, I am using Intentservice to fetch the data from server and store fetched data in to local sqlite db. I am using 5 IntentService to fetch and fill five tables. Data may up to 300 rows for each Intent Service. What should I do? IntentService Code: Code to call intentservice: and intent send m…
android error when select one image not multiple
I am trying to get images from my Gallery and upload them to the server. I want to allow the user to select multiple images from gallery. when I select two or more images it works very well. But when I select one image only it ignore it and return nothing. Here is my code and I am printing message
Compressing an Image before Uploading it to Firebase Storage
I am trying to Compress an Image before Uploading it to Firebase Storage using SiliCompressor library , but it seems not working , the ProgressDialog doesn’t stop. What i first did was to pick the Image from the Gallery into an ImageButton by clicking an ImageButton. Below is my code. So now am having a…