This is a jQuery-like library for android to help write android apps faster.
With SQ, Android Development becomes a piece of cake !
`sq.get("txt1");`
`sq.get(R.id.txt1);`
* Select all TextViews:
`sq.get("TextView");`
* Select TextView from a view
`sq.get(view,"txt1");`
`sq.get("idView","txt1");`
* Select TextView That starts with txt
`sq.get("txt*");`
(More selectors will be added soon)
- Set text:
sq.get("btn1").text("Click me!!");
- Get Value:
String s = sq.get("txt1").txt();
float f = sq.get("txt1").toFloat();
int i = sq.get("txt1").toInt();
Boolean b = sq.get("txt1").toBool();
- Change text color:
sq.get("txt1").color(Color.WHITE);
sq.get("txt1").color("#ffffff");
- Set background color:
sq.get("btn1").bg(Color.WHITE);
sq.get("btn1").bg("#ffffff");
- Set Image:
sq.get("imageView1").image("image");
sq.get("imageView1").image("http:\\");
- Screen width and height:
int w = sq.sWidth();
int h = sq.sHeight();
- Set width, height and position:
sq.get("btn1").width(sq.sWidth()).height(500).X(15).Y(10);
- Http get/post:
String s = sq.httpGet(url);
String s = sq.httpPost(url);
- Post data to the server:
List<NameValuePair> l = new LinkedList<NameValuePair>();
l.add(new BasicNameValuePair("id", "12345"));
HttpResponse response = sq.post(url,l);
- Download file:
sq.downloadNative(downloadUrl);
(using a service)
sq.download(downloadUrl);
- Open browser:
sq.browser("google.com");
- Click:
sq.get("btn1").click("functionName")
(functionName is the name of the function that will be called on click should be public in the activity class)
sq.get("btn1").click(listener)
- Touch:
sq.get("btn1").touch(listener)
- On:
sq.get("btn1").on("touchdown","functionName");
sq.get("btn1").on("touchup","functionName");
sq.get("btn1").on("move","functionName");
sq.get("btn1").on("click","functionName");
sq.get("btn1").on("longclick","functionName");
- Load File:
String s = sq.loadFileAsString("filename");
- Select a File:
sq.selectFile("txt");
- Select a Directory:
sq.selectDir();
- Thread:
sq.thread("after", "background");
sq.thread(Handler, "background");
- Delay:
sq.delay(2000, "after");
- Go to an other activity:
sq.to("nameActivity");
- Splash activity:
sq.splash(time, "nextActivity")
- Show:
sq.get("txt1").show();
- Hide:
sq.get("txt1").hide();
- Toggle:
sq.get("txt1").toggle();
- Toast:
sq.toast("short toast");
sq.Ltoast("long toast");
- Alert:
sq.alert("This is an alert!!");
sq.alert("Title","This is an alert!!");
sq.alert("ic_launcher","Title","This is an alert!!");
- Progress:
sq.progress(true);
sq.progress(true,"Loading");
sq.progress(false);
- Notification:
sq.notify("ic_launcher","title","subject","body");
,
- Bluetooth:
sq.bluetooth(true);
sq.bluetooth(false);
- Wifi:
sq.wifi(true);
sq.wifi(false);
- Call:
sq.call("123456");
- Sms:
sq.sms(sq.getPhoneNumber(),"Hello!");
- Mail:
sq.mail("[email protected]", "Hello", "Hello southapps !!");
- Camera:
sq.camImg(code);
sq.camVid(code);
- Gallery:
sq.gallery(code);
- Mac Address:
sq.macAddress("interfaceName");
- IP Address:
sq.ip(true);// IPv4
sq.ip(false);// IPv6
- IMEI, UUID:
sq.imei();
sq.uuid();
- Vibrate:
sq.vibrate(200);
- Is a Tablet
sq.isTablet();
- Hide keyborad
sq.hideKeyborad();
- Is Checked
Boolean b = sq.get("checkbox1").isChecked();
- Check Email:
Boolean b = sq.checkEmail("[email protected]");
- Device Name:
String s = sq.deviceName();
- Reload Activity:
sq.reload();