Skip to content

This a jQuery-like library fo android to help write android apps faster

License

Notifications You must be signed in to change notification settings

BoolHak/SouthQuery

Repository files navigation

SouthQuery

This is a jQuery-like library for android to help write android apps faster. With SQ, Android Development becomes a piece of cake !

SouthQuery Tutorial

DownLoad JAR ## Constructor: `S sq = S(this);` ## Selector: (you can use it on TextView,Button,ImageView,EditText,ImageButton,RadioButton,CheckBox,View) * Select a TextView:
`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)

Text:

  • 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");

Image:

  • 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:\\");

Size and position:

  • 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);

Web functions:

  • 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");

Events:

  • 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");

File:

  • Load File:
    String s = sq.loadFileAsString("filename");
  • Select a File:
    sq.selectFile("txt");
  • Select a Directory:
    sq.selectDir();

Threads:

  • Thread:
    sq.thread("after", "background");
    sq.thread(Handler, "background");
  • Delay:
    sq.delay(2000, "after");

Navigation:

  • Go to an other activity:
    sq.to("nameActivity");
  • Splash activity:
    sq.splash(time, "nextActivity")

Visibility:

  • Show:
    sq.get("txt1").show();
  • Hide:
    sq.get("txt1").hide();
  • Toggle:
    sq.get("txt1").toggle();

Toast,Alert,Progress,Notification:

  • 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");,

Other functions:

  • 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();

More functionality will be added soon

About

This a jQuery-like library fo android to help write android apps faster

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages