Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Tuesday, August 05, 2014

bugs

you sometimes settle to live with them. :)


i have the email icon on my android displaying (-1) notification for a couple of months now. noticed, but not bothered. i just check my email when it doesn't display (-1). haha

Wednesday, February 29, 2012

android: receive sms from different port

to receive sms from a different port, set this receiver in your AndroidManifest.xml

<receiver android:name=".SMSBcastReceiver">
        <intent-filter android:priority="10"> 
        <action android:name="android.intent.action.DATA_SMS_RECEIVED" /> 
<data android:scheme="sms" /> 
            <data android:port="13013" /> 
</intent-filter>
</receiver>


then set this in your SMSBcastReceiver class

public void onReceive(final Context context, Intent intent) {

Bundle bundle = intent.getExtras();

Object messages[] = (Object[]) bundle.get("pdus");
SmsMessage smsMessage[] = new SmsMessage[messages.length];

for (int n = 0; n < messages.length; n++) 
{
smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]);
}

smsOrigin = smsMessage[0].getDisplayOriginatingAddress();
smsData = smsMessage[0].getUserData();

for(int index=0; index<smsData.length; ++index)
{
smsBody += Character.toString((char)smsData[index]);
}
}

that's it, pansit!

Tuesday, February 28, 2012

android: emulator simulation

to simulate events on the android emulator, initialize a telnet session in your command prompt:
# telnet localhost 5554

to simulate sms receipt
telnet> sms send <number> <message>

to simulate gps location receipt
telnet> geo fix <long> <lat>

to install apk in emulator, in your command prompt:
# cd C:\Program Files\Android\android-sdk-windows\platform-tools
# adb install <installer.apk>


to access sqlite:

cd C:\Program Files\Android\android-sdk\platform-tools
adb -s emulator-5554 shell 
cd to your sqlite file
sqlite3 <db>

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...