How can I compile SQLite ICU Extension for using in my Android application as shared library?

I tried to compile it from official sqlite source, like described at with ndk-build, but it requires ICU library, which present in Android and linker fails with errors like

icu.c:416: undefined reference to `ucol_close_57'

My aim is to use it in library in SQLiteCustomExtension.


I am trying to parse a JSONArray from a MySQL Database in Android Studio, but i get the following exception:

org.json.JSONException: Value {"success":false,"0":{"success":false,"marker_id":null,"lat":null,"lng":null,"snippet":null},"1":{"success":false,"marker_id":null,"lat":null,"lng":null,"snippet":null},"2":{"success":false,"marker_id":null,"lat":null,"lng":null,"snippet":null},"3":{"success":false,"marker_id":null,"lat":null,"lng":null,"snippet":null}} of type org.json.JSONObject cannot be converted to JSONArray

What i am trying to do is to parse several markers containing double values for LatLng, and then placing those markers in Google Maps.

This is my code for placing the markers and making the request:

Response.Listener<String> responseListener = new Response.Listener<String>() {
                    public void onResponse(String response) {
                        try {

                            JSONArray jsonResponse = new JSONArray(response);
                            Log.i("RESPONSE:", "[" + jsonResponse + "]");

                            for (int i = 0; i < response.length(); i++) {

                                //boolean success = jsonResponse.getBoolean("success");
                                //double lat = jsonResponse.getDouble("lat");
                                //double lng = jsonResponse.getDouble("lng");
                                //int snippet = jsonResponse.getInt("snippet");

                                //LatLng Mplace = new LatLng(lat, lng);

                                //MarkerOptions marker = new MarkerOptions().position(Mplace).title("Marker").snippet("Snippet:" + "0");


                        } catch (JSONException e) {
                            Log.i("RESPONSE:", "[" + response + "]");
                                    "Error: " + e.getMessage(),



                MarkerRequest markerRequest = new MarkerRequest(responseListener);
                RequestQueue queue = Volley.newRequestQueue(AllMarkersActivity.this);

For now i have commented the actual placing of the markers and that is when i get the exception shown above. When i remove the commenting i get this red-text message:

getDouble (int) cannot be applied to (java.lang.String)

Here is my Request code:

public class MarkerRequest extends StringRequest {
private static final String MARKER_REQUEST_URL = "";
private Map<String, String> params;
//private JSONObject data = new JSONObject("");

public MarkerRequest(Response.Listener<String> listener){
    super(Request.Method.POST, MARKER_REQUEST_URL, listener, null);
    params = new HashMap<>();
public Map<String, String> getParams() {
    return params;

And here is my PHP script:

$con = mysqli_connect("myhost", "myuser", "mypass", "mydatabase");

/*$statement = mysqli_prepare($con);

$sql = "SELECT * FROM markers   ORDER BY marker_id  ASC ";
$strSQL = "SELECT * FROM `markers`  ORDER BY marker_id  ASC ";

$objQuery = mysql_query($statement, $strSQL) or die(mysql_error());
$arrRows = array();
$arryItem = array();*/

$statement = mysqli_prepare($con, "SELECT * FROM markers    ORDER BY marker_id  ASC ");
//mysqli_stmt_bind_result($statement, $colmarker_id, $collat, $collng, $colsnippet);

//$response = array();
$arrRows = array();
$arryItem = array();
    //$response["success"] = false;
$arrRows["success"] = false;
$arryItem["success"] = false;

while(mysqli_stmt_fetch($statement)) {
    $arryItem["marker_id"] = $arr["marker_id"];
    $arryItem["lat"] = $arr["lat"];
    $arryItem["lng"] = $arr["lng"];
    $arryItem["snippet"] = $arr["snippet"];
    $arrRows[] = $arryItem;

echo json_encode($arrRows);

So my question can be narrowed down to this:

How do i parse a JSONArray (within an array?), and how do i parse a double value within that JSONArray?

It would be nice with a code example, as i am still learning :)


Here i am trying to share the page with hashtag.

 ShareLinkContent linkContent = new ShareLinkContent.Builder()
                                .setContentTitle("Hello Facebook content tilte")
                                .setContentDescription("this is content description")
                                .setImageUrl(Uri.parse(""))  //Uri.parse(""))
                                .setShareHashtag(new ShareHashtag.Builder().setHashtag(influencer.hashtag_name).build())

Problem am facing here is,

-> After posting, I am not getting the image in setImageUrl() in post, instead i am getting the shared page image.

Its for working fine(what i except) without setShareHashTag(),but my requirement is to include the hashtag.

Here i have attached the screenshots,

Screenshot 1

After posting,

Screenshot 2

I don't know what is missing,if any one know the answer please help !!

Thanks in advance.

I am trying to send these JSONbject to server for login and its working like a charm in android lollipop and marshmallow but when I trying to login in android kitkat and below version then its giving incorrect username and password error because of json order mixup. How can I solve that ?

       JSONObject jsonObject = new JSONObject();
            try {
                jsonObject.put("USERName", username);
                jsonObject.put("LOGINPASSWORD", password);
                jsonObject.put("IMEINUMBER1", imeino);
                jsonObject.put("Latitude", latitude);
                jsonObject.put("Longitude", longitude);
            } catch (JSONException e) {

Below is my jsonObject which mixup in Android Kitkat and below versions.


In my project i have a static TextView. This TexView is changes based on previous page Button press. title.setText(heading) is executing without error but text is not changing.


The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at

Unable to build the android prject with following error. Error:(26, 18) No resource found that matches the given name (at ‘src’ with value ’@drawable/abc_ic_clear_mtrl_alpha’).

I have been trying to add the ConstraintLayout to my project with no success.

In my app level build.gradle file, the gradle version is and in my dependencies,

I get the following error message when I try to sync the project

Error:Could not find

I am running Android Studio 2.2 Beta 3.

I have the json file like this i like to convert the object in to the program

      `     "AvailableLeaves": 4,
            "IsHalfdayAllowed": true,
            "LeaveID": 3,
            "LeaveName": "Sick Leave",
            "MaximumNoOfDays": 8,
            "MinimumNoOfDays": 1,
            "ShortName": "SL",
            "AlternateStaffStatusDetails": [
        "AlternateStaffName": null,
            "Comment": "Approved",
            "GUID": "01B5A3AC-3274-44AF-A06F-03D085AB57F7",
            "IsModified": false,
            "ScheduleID": 7,
            "Status": 1
            "ApplicationID": 12,
            "AppliedByID": 0,
            "AppliedByName": null,
            "ApprovalStatus": 1,
            "Comment": "Approved",
            "LeaveAppliedDate": "/Date(1454610600000+0530)/",
            "LeaveDateFrom": "/Date(1454610600000+0530)/",
            "LeaveDateTo": "/Date(1454610600000+0530)/",
            "LeaveRequestSentTo": "Ramesh",
            "LeaveStatusID": 0,
            "Reason": "Fever"`

above file is my json can any one tell how to convert the this json object . i give example to another method which dont have objects in this array i gave attendance json file example

        "ID": 0,
        "Name": "MA151",
        "<DaysAttended>k__BackingField": "3",
        "<Percentage>k__BackingField": 100,
        "Held": 3,
        "Sem": "Term II"

String Code;
int ID;
String Name;
 int Held;
String Sem;

public OtherAttendanceDetailsItem(
        String Code,
        int ID,
        String Name,
        int Held,
        String Sem
) {

    this.Code = Code;
    this.ID = ID;
    this.Name = Name;
    this.Held = Held;
    this.Sem = Sem;

public String getSem() {
    return Sem;

public void setSem(String sem) {
    Sem = sem;

public int getHeld() {

    return Held;

public void setHeld(int held) {
    Held = held;

public String getName() {

    return Name;

public void setName(String name) {
    Name = name;

public int getID() {

    return ID;

public void setID(int ID) {
    this.ID = ID;

public String getCode() {

    return Code;

public void setCode(String code) {
    Code = code;

and this

public class StaffAttendanceDetails extends StaffAbstractOtherDetails {

private static final String DEBUG_TAG = "StaffattendanceDetails";
List<OtherStaffAttendanceDetailsItem> StaffattendanceDetailsList;

public StaffAttendanceDetails() {

public void init(String body) {
    try {
        JSONObject resultJSON = new JSONObject(body);

        Log.d("resultJSON ", body + "");
        if (resultJSON.getInt("ServiceResult") == 0) {

            List<OtherStaffAttendanceDetailsItem> StaffattendanceDetailList = StaffattendanceDetailsList(resultJSON.getJSONArray("DataList"));

                    "Date": "/Date(1433874600000+0530)/",
                    "InTime": "10:04AM",
                    "IsLateSanctioned": false,
                    "LateRemark": "Personal",
                    "LateSanctionedBy": null,
                    "OutTime": null

            for (int i = 0; i < StaffattendanceDetailList.size(); i++) {
                OtherStaffAttendanceDetailsItem item = StaffattendanceDetailList.get(i);



                Log.d(DEBUG_TAG, "init: doing here");

        } else {

    } catch (Exception t) {
        Log.e("JSON error", t + "");

private List<OtherStaffAttendanceDetailsItem> StaffattendanceDetailsList(JSONArray body) {
    List<OtherStaffAttendanceDetailsItem> data = new ArrayList<>();
    for (int i = 0, size = body.length(); i < size; i++) {
        try {
            JSONObject objectInArray = body.getJSONObject(i);
            OtherStaffAttendanceDetailsItem OtherStaffattendanceDetailsItem = new OtherStaffAttendanceDetailsItem
        } catch (Exception e) {
            Log.e(DEBUG_TAG, "getattendanceList: " + e.getMessage());
    return data;

public String getURL(String id) {
    return "/ManagementService.svc/GetStaffAttendance?StaffID=01B5A3AC-3274-44AF-A06F-03D085AB57F7\n";

please how to convert json object like above example ..any way thanks for answering before

In the last period i am having the chance to develop some apps for personal reason, and taking a look to what today the companies are organizing their work in the Android Ecosystem i encountered many and many times this kind of project configuration:

  • MVP (Model-View-Presenter) as Design Pattern for app architecture;
  • RxJava for Reactive programming event-based;
  • Dagger2 for dependency injection;
  • ButterKnife for fields binding with annotations, used in combo with Dagger2 in order to make your life simplier;
  • Espresso and Mockito for testing (really nice to use in this kind of environment with this kind of settings)

So, is this becoming a new standard, in your opinion? If so, do you think that is a good idea apply this (relatively) new guidelines and you usually use this kind of project tools/pattern/libraries into your apps or you think there is something better? If you don't like, it, why? What do you think could be a better approach?

(Obviously each project is different, and for each project is always better engineerize the best solution/architecture possible for the kind of users/team/dev involved. I am trying to understand/discuss this kind of model that seems to become widely used in his concept in many, many companies)

Thank you for your time, i hope to create an interesting discussion on the argument in order to all improve our skillset/projects.

Enjoy your day!

I have received my app rejected some days ago due to following reason:

We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 9.3.5 on Wi-Fi connected to an IPv6 network.

Specifically, we found an error message is produced when logging in. We've attached a screenshot for your reference.

Next Steps

Please run your app on a device while connected to an IPv6 network (all apps must support IPv6) to identify the issue(s), then revise and resubmit your app for review.

If we misunderstood the intended behavior of your app, please reply to this message in Resolution Center to provide information on how these features were intended to work.

For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce the issue(s). For updates, install the new version as an update to the previous version, then follow the steps to reproduce the issue(s).


For information about supporting IPv6 Networks, please refer to Supporting IPv6 DNS64/NAT64 Networks and About Networking

If you have difficulty reproducing a reported issue, please try testing the workflow described in Technical Q&A QA1764: How to reproduce bugs reported against App Store submissions.

I have set two IPv6 networks, one of them in a time capsule and other sharing from my MacBook Pro. From the Time Capsule's network (who is a fully IPv6 network) the app works properly. From the MacBook Pro shared network I receive two results... When the device connect to this IPv6 network and get only DNS configured, the app works, but when it receive the DNS and one IP with the format 169.254.X.X the app crash the connection to the server.

The problem is that $http request answer goes by error side instead success side. I have tried with Ionic $http and cordova-http plugin ( and the result was the same. I don't know what's happening, because I have a Cordova (only Cordova, not Ionic) project with AngularJS and it doesn't fail. Then, what's the difference between Ionic $http and AngularJS $http? I can't understand what's the difference.

I can't post images due to my low reputation (I'm reading from years, but it's my first post), but can see here. Any help would be appreciated because it's so important to me solve it asap.

$http request example (using Ionic $http and cordova-http plugin):

callWs: function(ws, method, data){
  var defferer = $q.defer();

  if (device.platform == 'Android' || device.platform == 'iOS'){

      {"cache-control": "no-cache, private, no-store, must-revalidate",
      "Authorization": basic_auth,
      "Content-Type": "application/x-www-form-urlencoded; charset=utf-8"
    function(res) {
    }, function(error) {

  } else {

        url: url_request,
        method: 'POST',
        withCredentials: true,
        timeout: HTTPTIMEOUT,
        headers: {
            'cache-control': 'no-cache, private, no-store, must-revalidate',
            'Authorization': basic_auth,
            'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
        dataType : 'json',
        data: data_sent
    }).then(function (res) {
    }, function (error) {


  return defferer.promise;


This might be the duplicate question by title, but my requirements are very different.

My Requirements are that I want to create a Closed-Source Framework of my iOS application "A", so that when I add that framework in any iOS application "B",it can interact with my application "A", that is already installed in that phone.

I know there are some ways I can interact with other iOS apps using URL SCHEMES or RoutingHTTPServer etc. but I want to achieve following points.

  1. Communication must be bi-directional so that when application "B" interacts with application "A", then "A" application do some stuff for "B" application and then return some data to application "B". (just Like when we use sign-in with Facebook feature and sign-in with linkedin features)
  2. Does not matter the application is closed or application is in the background, application "B" must interact with application "A". (Because RoutingHTTPServer does not work if app is not in background mode)
  3. If application is not installed then I can open my custom pages from my application "B" using the framework to get user credentials and get session.

Can anybody help me on this. I would really appreciate his help.

Thanks in advance

We have a UINavigationViewController as root view controller in AppDelegate:

 Restore *callRestore=[[Restore alloc]initWithNibName:@"Restore" bundle:nil];
 self.navigationController = [[UINavigationController alloc] initWithRootViewController:callRestore];
 self.window.rootViewController = self.navigationController;

We are pushing a new view controller (TabViewController) from above Restore:

 callTabView=[[TabViewController alloc] initWithNibName:@"TabViewController" bundle:nil];
 [self.navigationController pushViewController:callTabView animated:YES];

In this TabViewController we are adding UITabBarController programatically as subview and in this UITabBarController we have 5 UINavigationBarController as view controllers:

NSArray* controllers = [NSArray arrayWithObjects:navControllerDashboard, navControllerAccounts, navControllerTransation,navControllerCallDisplayReports,navControllerMore, nil];
self.tabBarController.viewControllers = controllers;
self.tabBarController.delegate = self;
self.tabBarController.view.frame = self.view.frame;
[self.view addSubview:self.tabBarController.view];

When we are rotating any view from these 5 UINavigationViewController we are getting 2 UINavigationBar on top in both landscape mode portrait mode. Check below image. enter image description here enter image description here

and didRotateFromInterfaceOrientation is not calling from these 5 UINavigationViewController view.

Any help?

I trying to implement this hierarchy in app. I know that maybe its a not so good UI solution. But I have design of app and I must to implement it.

I want to approach for this:

enter image description here

But I see always FirstTabBarController in ViewControllers which have embeded in SecondTabBarController.

What the best way to implement this?

Since a couple of days I'm having an extremely high crash rate (I use Crashlytics from Fabric to get my crash reports) of the following crash:


At the following "breakpoint":

mbgl::FillBucket::drawElements(mbgl::PlainShader&, mbgl::gl::ObjectStore&)

With the following stack:

0  libsystem_platform.dylib       0x2202e1c4 _platform_memmove$VARIANT$CortexA9 + 136
1  IMGSGX543GLDriver              0x318d4acd glrSGXRenderVertexArray
2  IMGSGX543GLDriver              0x318d4acd glrSGXRenderVertexArray
3  GLEngine                       0x31e3f4cf glDrawElements_ACC_ES2Exec
4  OpenGLES                       0x24085de3 glDrawElements + 38
5  name_of_my_app                      0x2c9af3 mbgl::FillBucket::drawElements(mbgl::PlainShader&, mbgl::gl::ObjectStore&) + 3353331
6  name_of_my_app                      0x2d2f53 mbgl::Painter::renderFill(mbgl::FillBucket&, mbgl::style::FillLayer const&, mbgl::UnwrappedTileID const&, std::__1::array<double, 16ul> const&) + 3391315
7  name_of_my_app                      0x2d0741 void mbgl::Painter::renderPass<std::__1::reverse_iterator<std::__1::__wrap_iter<mbgl::RenderItem const*> > >(mbgl::RenderPass, std::__1::reverse_iterator<std::__1::__wrap_iter<mbgl::RenderItem const*> >, std::__1::reverse_iterator<std::__1::__wrap_iter<mbgl::RenderItem const*> >, int, signed char) + 3381057
8  name_of_my_app                      0x2cfe17 mbgl::Painter::render(mbgl::style::Style const&, mbgl::FrameData const&, mbgl::SpriteAtlas&) + 3378711
9  name_of_my_app                      0x2c0549 mbgl::Map::Impl::render() + 3315017
10 name_of_my_app                      0x2c03d1 mbgl::Map::render() + 3314641
11 name_of_my_app                      0x257423 -[MGLMapView glkView:drawInRect:] + 2884643
12 GLKit                          0x2988d523 -[GLKView _display:] + 278
13 name_of_my_app                      0x257dc9 -[MGLMapView updateFromDisplayLink] + 2887113
14 QuartzCore                     0x2495a9eb CA::Display::DisplayLinkItem::dispatch() + 106
15 QuartzCore                     0x2495a837 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 594
16 IOMobileFramebuffer            0x2404150b IOMobileFramebufferVsyncNotifyFunc + 86
17 IOKit                          0x22550759 IODispatchCalloutFromCFMessage + 256
18 CoreFoundation                 0x222ae41d __CFMachPortPerform + 132
19 CoreFoundation                 0x222c2623 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
20 CoreFoundation                 0x222c1d37 __CFRunLoopDoSource1 + 342
21 CoreFoundation                 0x222c0149 __CFRunLoopRun + 1688
22 CoreFoundation                 0x2220f2e9 CFRunLoopRunSpecific + 520
23 CoreFoundation                 0x2220f0d5 CFRunLoopRunInMode + 108
24 GraphicsServices               0x237ffac9 GSEventRunModal + 160
25 UIKit                          0x268d40b9 UIApplicationMain + 144
26 name_of_my_app                      0xce821 main (main.m:16)
27 libdispatch.dylib              0x21eb7873 (Missing)

I think this is linked to my latest update where I added a UIScrollView on a ViewController, and on that View I display some text. If the text is too long there is a "See more" button that displays all the text. To do this, I change some constraints, and I have some "setNeedsUpdateConstraints" and "layoutIfNeeded".

I'm just stuck here, as I cannot pinpoint the issue, and I'm unable to get reproduce this crash on my simulators or on my own iPhone.

I have MapBox installed (I've seen some people have the same crashes but I can't imagine this is MapBox as it's not mentionned anywhere in the stack and I haven't changed any MapBox related code...).

It seems like that iOS has issues with calculations that are made on-scroll. While other browser (mobile included) don't have any issues it seems like iOS takes up too much time with calculating. Here is an example of what I mean:

$(window).on("scroll", function() {
    if($(window).width() <=601) {

        var elem1Top = $(".element1").offset().top();
        var elem1Bot = elem1Top + $(".element1").height();
        var elem2Top = $(".element2").offset().top();
        var elem2Bot = elem2Top + $(".element2").height();

        if( elem2Top < elemen1Bot && elem2Bot > elem1Top ) {
            $(".element2").css("visibility", "visible");
        } else {
            $(".element2").css("visibility", "hidden");

    } else {
         //do other stuff

Basically we have element1 which sits on my page and element2 which has position: fixed, visibility: hidden and sits in the middle of the screen. As soon as element2 reaches the height of element1 it should be shown. The whole code block inside the first if-block is also called initially once and during $(window).resize. It works fine on every browser except iOS. Any thoughts?

I'm writing an API for a bunch of different aspects of my project. I have some code that currently looks like

interface LoginCredentialRepository {

    Callable<LoginCredential> fetchCredentials(String username);

I had the thought to add a new interface to the mix, a FetchLoginCredentialTask that looked something like

interface FetchLoginCredentialsTask extends Callable<LoginCredential> {


and change fetchCredentials to

FetchLoginCredentialsTask fetchCredentials(String username);

Whereby the new interface doesn't actually change anything at the moment (but maybe could in the future).

What reason would there be to do something like this?

I am trying to develop a platform-independent application with Xamarin.Forms.

The MainPage contains a button. After clicking that button, I'd like to check the android whether the Google Play Services are available or not. Therefore I created an interface and implemented this interface in the android project.

The class which implements the interface, doesn't know anything about the android context. Since the method is called in the main project, I can't pass the context from there.

Is there any best-practice approach for things like this?

I don't really know if it belongs here or stackoverflow. It's somewhere between.

I downloaded an open-source software under the GNU GPLv3 license. I am planning to write a plug-in for that software and distribute the plugin commercially without disclosing the plugin's source code. Is this allowed?

Note: I know that GPLv3 is a copyleft license and any modifications to the code must also be made available under the GPL. But here, I am not touching the source code and I am making a plugin that connects to the GPLv3 code.

i am new to ubuntu .Using Ubuntu 14.04 LTS.

1 - i want to start my GUI application on ubuntu start up. 2 - the GUI application needs sudo permission . is there any way i can start my application without entering suso password and run my application.


I'm working on a project which revolves around a database of about 750.000 entities. Let's just say these entities are musical works. Each musical work is associated with an album, one or more composers and some other entities.

The business who owns this database has bought services from other providers which requires the business to "notify" these providers when a musical work gets created, updated or deleted in the database.

An important note here is that any given musical work is considered updated if the entity itself (the musical work) or any entity which the musical work is associated with gets updated. In other words, if the composer of the musical work "Air On The G String" was renamed from "Bacch" to "Bach" - then that musical work (and all other tracks related to that composer) should be considered updated.

The entities are stored in a relational database, and there is no built-in functionality as such in the database which allows us to keep track of which entities have been created, updated or deleted. It is also a requirement to not rely on any such functionality. Furthermore, the graph of entities which makes up a single musical work can grow quite large. I don't think creative SQL statements would be the way to go here to somehow discover created, updated or deleted entities.

What I've been thinking is to set up a job which once a day simply iterates over all musical works and creates a hash for each and every one. I've so far come to the conclusion that for any given musical work in the database, the job will have to pull the musical work itself from the database along with associated entities (album, shares, composers etc) and generate a hash based on relevant fields.

enter image description here

I believe that a hash can be generated by concatenating track fields, share fields, composer fields and album fields - and then create a hash based on that (long) string.

The generated hash for each musical work will then be stored in a separate database, and by doing it this way the job can compare musical works (through the generated hashes) for each run vs. the previous run.

This way, the job will be "data store agnostic" (the entities can come directly from the database, from a webservice or something else) and the actual state of the last replicated version of any given musical work will be safely stored as a hash.

Now, I'd like a sanity check on this design. Does this seem to be a fair way to solve this task or am I complicating things?