Skip to content

Instantly share code, notes, and snippets.

View AdilSoomro's full-sized avatar

Adil Soomro AdilSoomro

View GitHub Profile
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<result>
<message>
<message_id>4</message_id>
<r_id>18</r_id>
<flag>0</flag>
<expiry_date>Expires on 03 Jun, 2016</expiry_date>
<status>unseen</status>
<datetime>2016-01-19 05:28:12</datetime>
<subject>Testing Lunch Box</subject>
<result>
<status>1</status>
<eatout id="18">Sholay Restaurant</eatout>
</result>
<response>
<code>1</code>
<status>Success</status>
<user id="17">Omair Bangash</user>
<message>This number has been verified successfully.</message>
</response>
@AdilSoomro
AdilSoomro / gist:4328066
Last active December 9, 2015 21:08
baresip initialization code
int err;
/* Initialise System library */
err = libre_init();
/* Initialise dynamic modules */
mod_init();
err = net_init(); // do not prefer IP v6
if (err) {
NSLog(@"network init failed (%@)\n", strerror(err));
@AdilSoomro
AdilSoomro / AwesomeAdapter.getView()
Created December 16, 2012 15:04
AwesomeAdapter is used to show speech bubble in ListView as row.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Message message = (Message) this.getItem(position);
ViewHolder holder;
if(convertView == null)
{
holder = new ViewHolder();
convertView = LayoutInflater.from(mContext).inflate(R.layout.sms_row, parent, false);
holder.message = (TextView) convertView.findViewById(R.id.message_text);
@AdilSoomro
AdilSoomro / sms_row.xml
Created December 16, 2012 14:39
android layout for row used in speech bubble ListView
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/message_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@AdilSoomro
AdilSoomro / TabActivity.java
Created August 9, 2012 08:35
iphone like tab host
public class CustomTabsActivity extends TabActivity{
private TabHost tabHost;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setTabs();
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dip"
android:layout_height="55dip"
android:layout_weight="1"
android:orientation="vertical"
android:background="@drawable/tab_indicator"
android:padding="5dp">
@AdilSoomro
AdilSoomro / tab_focus.xml
Created August 9, 2012 08:28
iphone like tab host
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:left="@dimen/tab_space" android:right="@dimen/tab_space">
<shape android:shape="rectangle">
<gradient android:angle="-90" android:startColor="@color/tabMedium"
android:endColor="@color/tabDark" />
</shape>
</item>
<!-- draw tab background -->