I'm currently developing a marketing app on Android, which has a feature to send a URL via SMS. Because I'm using SMS, I want to make the text as short as possible, so it won't be split into parts.
The URL is generated dynamically by app. Different contact will result in different URL, as the app puts some "contact related information" to the URL. And this information is the one needs to be shortened, not the base URL.
I tried using Base64 to shorten the string, but it's not working.
Before
Text: Myself|1234567890
Length: 17
After
Text: TXlzZWxmfDEyMzQ1Njc4OTA=
Length: 25
Then I tried Deflater, and the result is better than Base64, but still it's not shorten the string.
Before
Text: Myself|1234567890
Length: 17
After
Text: x��,N�I�1426153��4����3��
Length: 24
I've also tried GZIP, and the result is much worse than other method.
Before
Text: Myself|1234567890
Length: 17
After
Text: ����������������,N�I�1426153��4�����w��������
Length: 36
After comparing test results, I decided to use Base64 as it sometimes works, but I'm completely not satisfied. Can anyone give me a better approach?
EDIT:
I need this String Shortening to be executed OFFLINE, without internet connection. I'm terribly sorry for this sudden change, as our developer team decided so. Any idea?