diff --git a/glib-2.28.1/glib/gstrfuncs.c b/aglib-2.28.1/glib/gstrfuncs.c
index 04f686b..9157b5f 100644
--- a/glib-2.28.1/glib/gstrfuncs.c
+++ b/aglib-2.28.1/glib/gstrfuncs.c
@@ -442,8 +442,12 @@ g_ascii_strtod (const gchar *nptr,
 
   fail_pos = NULL;
 
+#ifdef ANDROID
+  decimal_point = ".";
+#else
   locale_data = localeconv ();
   decimal_point = locale_data->decimal_point;
+#endif
   decimal_point_len = strlen (decimal_point);
 
   g_assert (decimal_point_len != 0);
@@ -656,8 +660,12 @@ g_ascii_formatd (gchar       *buffer,
 
   _g_snprintf (buffer, buf_len, format, d);
 
+#ifdef ANDROID
+  decimal_point = ".";
+#else
   locale_data = localeconv ();
   decimal_point = locale_data->decimal_point;
+#endif
   decimal_point_len = strlen (decimal_point);
 
   g_assert (decimal_point_len != 0);
diff --git a/glib-2.28.1/gio/libasyncns/asyncns.c b/aglib-2.28.1/gio/libasyncns/asyncns.c
index 155f491..c109810 100644
--- a/glib-2.28.1/gio/libasyncns/asyncns.c
+++ b/aglib-2.28.1/gio/libasyncns/asyncns.c
@@ -18,6 +18,62 @@
   <http://www.gnu.org/licenses/>.
 ***/
 
+//unsafe and unchecked patch for the arp/*.h definitions in Android.
+#ifdef ANDROID
+/*%
+ * Inline versions of get/put short/long.  Pointer is advanced.
+ */
+#define NS_INT32SZ    4    /*%< #/bytes of data in a u_int32_t */
+#define NS_INT16SZ    2    /*%< #/bytes of data in a u_int16_t */
+#define NS_GET16(s, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (s) = ((u_int16_t)t_cp[0] << 8) \
+        | ((u_int16_t)t_cp[1]) \
+        ; \
+    (cp) += NS_INT16SZ; \
+} while (0)
+#define NS_GET32(l, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (l) = ((u_int32_t)t_cp[0] << 24) \
+        | ((u_int32_t)t_cp[1] << 16) \
+        | ((u_int32_t)t_cp[2] << 8) \
+        | ((u_int32_t)t_cp[3]) \
+        ; \
+    (cp) += NS_INT32SZ; \
+} while (0)
+
+
+#define    GETSHORT        NS_GET16
+#define    GETLONG            NS_GET32
+
+#define ns_c_in     1    /*%< Internet. */
+#define ns_t_srv     33    /*%< Internet. */
+#define C_IN        ns_c_in
+#define    T_SRV        ns_t_srv
+
+typedef struct {
+    unsigned    id :16;        /*%< query identification number */
+            /* fields in third byte */
+    unsigned    rd :1;        /*%< recursion desired */
+    unsigned    tc :1;        /*%< truncated message */
+    unsigned    aa :1;        /*%< authoritive answer */
+    unsigned    opcode :4;    /*%< purpose of message */
+    unsigned    qr :1;        /*%< response flag */
+            /* fields in fourth byte */
+    unsigned    rcode :4;    /*%< response code */
+    unsigned    cd: 1;        /*%< checking disabled by resolver */
+    unsigned    ad: 1;        /*%< authentic data from named */
+    unsigned    unused :1;    /*%< unused bits (MBZ as of 4.9.3a3) */
+    unsigned    ra :1;        /*%< recursion available */
+            /* remaining bytes */
+    unsigned    qdcount :16;    /*%< number of question entries */
+    unsigned    ancount :16;    /*%< number of answer entries */
+    unsigned    nscount :16;    /*%< number of authority entries */
+    unsigned    arcount :16;    /*%< number of resource entries */
+} HEADER;
+
+#endif
+
 #ifdef HAVE_CONFIG_H
 #include "g-asyncns.h"
 #endif
diff --git a/glib-2.28.1/gio/gresolver.c b/aglib-2.28.1/gio/gresolver.c
index 657505b..6070a0d 100644
--- a/glib-2.28.1/gio/gresolver.c
+++ b/aglib-2.28.1/gio/gresolver.c
@@ -20,6 +20,61 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#ifdef ANDROID
+/*%
+ * Inline versions of get/put short/long.  Pointer is advanced.
+ */
+#define NS_INT32SZ    4    /*%< #/bytes of data in a u_int32_t */
+#define NS_INT16SZ    2    /*%< #/bytes of data in a u_int16_t */
+#define NS_GET16(s, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (s) = ((u_int16_t)t_cp[0] << 8) \
+        | ((u_int16_t)t_cp[1]) \
+        ; \
+    (cp) += NS_INT16SZ; \
+} while (0)
+#define NS_GET32(l, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (l) = ((u_int32_t)t_cp[0] << 24) \
+        | ((u_int32_t)t_cp[1] << 16) \
+        | ((u_int32_t)t_cp[2] << 8) \
+        | ((u_int32_t)t_cp[3]) \
+        ; \
+    (cp) += NS_INT32SZ; \
+} while (0)
+
+
+#define    GETSHORT        NS_GET16
+#define    GETLONG            NS_GET32
+
+#define ns_c_in     1    /*%< Internet. */
+#define ns_t_srv     33    /*%< Internet. */
+#define C_IN        ns_c_in
+#define    T_SRV        ns_t_srv
+
+typedef struct {
+    unsigned    id :16;        /*%< query identification number */
+            /* fields in third byte */
+    unsigned    rd :1;        /*%< recursion desired */
+    unsigned    tc :1;        /*%< truncated message */
+    unsigned    aa :1;        /*%< authoritive answer */
+    unsigned    opcode :4;    /*%< purpose of message */
+    unsigned    qr :1;        /*%< response flag */
+            /* fields in fourth byte */
+    unsigned    rcode :4;    /*%< response code */
+    unsigned    cd: 1;        /*%< checking disabled by resolver */
+    unsigned    ad: 1;        /*%< authentic data from named */
+    unsigned    unused :1;    /*%< unused bits (MBZ as of 4.9.3a3) */
+    unsigned    ra :1;        /*%< recursion available */
+            /* remaining bytes */
+    unsigned    qdcount :16;    /*%< number of question entries */
+    unsigned    ancount :16;    /*%< number of answer entries */
+    unsigned    nscount :16;    /*%< number of authority entries */
+    unsigned    arcount :16;    /*%< number of resource entries */
+} HEADER;
+#endif
+
+
 #include "config.h"
 #include <glib.h>
 #include "glibintl.h"
diff --git a/glib-2.28.1/gio/gthreadedresolver.c b/aglib-2.28.1/gio/gthreadedresolver.c
index 8c98f47..4f728a8 100644
--- a/glib-2.28.1/gio/gthreadedresolver.c
+++ b/aglib-2.28.1/gio/gthreadedresolver.c
@@ -20,6 +20,60 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#ifdef ANDROID
+/*%
+ * Inline versions of get/put short/long.  Pointer is advanced.
+ */
+#define NS_INT32SZ    4    /*%< #/bytes of data in a u_int32_t */
+#define NS_INT16SZ    2    /*%< #/bytes of data in a u_int16_t */
+#define NS_GET16(s, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (s) = ((u_int16_t)t_cp[0] << 8) \
+        | ((u_int16_t)t_cp[1]) \
+        ; \
+    (cp) += NS_INT16SZ; \
+} while (0)
+#define NS_GET32(l, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (l) = ((u_int32_t)t_cp[0] << 24) \
+        | ((u_int32_t)t_cp[1] << 16) \
+        | ((u_int32_t)t_cp[2] << 8) \
+        | ((u_int32_t)t_cp[3]) \
+        ; \
+    (cp) += NS_INT32SZ; \
+} while (0)
+
+
+#define    GETSHORT        NS_GET16
+#define    GETLONG            NS_GET32
+
+#define ns_c_in     1    /*%< Internet. */
+#define ns_t_srv     33    /*%< Internet. */
+#define C_IN        ns_c_in
+#define    T_SRV        ns_t_srv
+
+    typedef struct {
+        unsigned    id :16;        /*%< query identification number */
+        /* fields in third byte */
+        unsigned    rd :1;        /*%< recursion desired */
+        unsigned    tc :1;        /*%< truncated message */
+        unsigned    aa :1;        /*%< authoritive answer */
+        unsigned    opcode :4;    /*%< purpose of message */
+        unsigned    qr :1;        /*%< response flag */
+        /* fields in fourth byte */
+        unsigned    rcode :4;    /*%< response code */
+        unsigned    cd: 1;        /*%< checking disabled by resolver */
+        unsigned    ad: 1;        /*%< authentic data from named */
+        unsigned    unused :1;    /*%< unused bits (MBZ as of 4.9.3a3) */
+        unsigned    ra :1;        /*%< recursion available */
+        /* remaining bytes */
+        unsigned    qdcount :16;    /*%< number of question entries */
+        unsigned    ancount :16;    /*%< number of answer entries */
+        unsigned    nscount :16;    /*%< number of authority entries */
+        unsigned    arcount :16;    /*%< number of resource entries */
+    } HEADER;
+#endif
+
 #include "config.h"
 #include <glib.h>
 #include "glibintl.h"
diff --git a/glib-2.28.1/gio/gunixresolver.c b/aglib-2.28.1/gio/gunixresolver.c
index 9f430ec..cacd3de 100644
--- a/glib-2.28.1/gio/gunixresolver.c
+++ b/aglib-2.28.1/gio/gunixresolver.c
@@ -20,6 +20,62 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#ifdef ANDROID
+/*%
+ * Inline versions of get/put short/long.  Pointer is advanced.
+ */
+#define NS_INT32SZ    4    /*%< #/bytes of data in a u_int32_t */
+#define NS_INT16SZ    2    /*%< #/bytes of data in a u_int16_t */
+#define NS_GET16(s, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (s) = ((u_int16_t)t_cp[0] << 8) \
+        | ((u_int16_t)t_cp[1]) \
+        ; \
+    (cp) += NS_INT16SZ; \
+} while (0)
+#define NS_GET32(l, cp) do { \
+    register const u_char *t_cp = (const u_char *)(cp); \
+    (l) = ((u_int32_t)t_cp[0] << 24) \
+        | ((u_int32_t)t_cp[1] << 16) \
+        | ((u_int32_t)t_cp[2] << 8) \
+        | ((u_int32_t)t_cp[3]) \
+        ; \
+    (cp) += NS_INT32SZ; \
+} while (0)
+
+
+#define    GETSHORT        NS_GET16
+#define    GETLONG            NS_GET32
+
+#define ns_c_in     1    /*%< Internet. */
+#define ns_t_srv     33    /*%< Internet. */
+#define C_IN        ns_c_in
+#define    T_SRV        ns_t_srv
+
+    typedef struct {
+        unsigned    id :16;        /*%< query identification number */
+        /* fields in third byte */
+        unsigned    rd :1;        /*%< recursion desired */
+        unsigned    tc :1;        /*%< truncated message */
+        unsigned    aa :1;        /*%< authoritive answer */
+        unsigned    opcode :4;    /*%< purpose of message */
+        unsigned    qr :1;        /*%< response flag */
+        /* fields in fourth byte */
+        unsigned    rcode :4;    /*%< response code */
+        unsigned    cd: 1;        /*%< checking disabled by resolver */
+        unsigned    ad: 1;        /*%< authentic data from named */
+        unsigned    unused :1;    /*%< unused bits (MBZ as of 4.9.3a3) */
+        unsigned    ra :1;        /*%< recursion available */
+        /* remaining bytes */
+        unsigned    qdcount :16;    /*%< number of question entries */
+        unsigned    ancount :16;    /*%< number of answer entries */
+        unsigned    nscount :16;    /*%< number of authority entries */
+        unsigned    arcount :16;    /*%< number of resource entries */
+    } HEADER;
+#endif
+
+
+
 #include "config.h"
 #include <glib.h>
 #include "glibintl.h"
diff --git a/glib-2.28.1/gio/glocalfileinfo.c b/aglib-2.28.1/gio/glocalfileinfo.c
index 30ea97b..b4ac38a 100644
--- a/glib-2.28.1/gio/glocalfileinfo.c
+++ b/aglib-2.28.1/gio/glocalfileinfo.c
@@ -42,6 +42,9 @@
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
+#ifdef ANDROID
+#include <pwd.h>
+#endif
 #ifdef HAVE_SELINUX
 #include <selinux/selinux.h>
 #endif
@@ -1096,7 +1099,11 @@ lookup_uid_data (uid_t uid)
       if (pwbufp->pw_name != NULL && pwbufp->pw_name[0] != 0)
 	data->user_name = convert_pwd_string_to_utf8 (pwbufp->pw_name);
 
+#ifdef ANDROID
+      gecos = NULL;
+#else
       gecos = pwbufp->pw_gecos;
+#endif
 
       if (gecos)
 	{
diff --git a/glib-2.28.1/gio/ginetaddress.c b/aglib-2.28.1/gio/ginetaddress.c
index 0f67e4f..03b701e 100644
--- a/glib-2.28.1/gio/ginetaddress.c
+++ b/aglib-2.28.1/gio/ginetaddress.c
@@ -20,6 +20,27 @@
  * Authors: Christian Kellner <gicmo@gnome.org>
  *          Samuel Cormier-Iijima <sciyoshi@gmail.com>
  */
+#ifdef ANDROID
+#define IN6_IS_ADDR_MC_NODELOCAL(a) \
+    (IN6_IS_ADDR_MULTICAST(a)                          \
+     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x1))
+
+#define IN6_IS_ADDR_MC_LINKLOCAL(a) \
+    (IN6_IS_ADDR_MULTICAST(a)                          \
+     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x2))
+
+#define IN6_IS_ADDR_MC_SITELOCAL(a) \
+    (IN6_IS_ADDR_MULTICAST(a)                          \
+     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x5))
+
+#define IN6_IS_ADDR_MC_ORGLOCAL(a) \
+    (IN6_IS_ADDR_MULTICAST(a)                          \
+     && ((((__const uint8_t *) (a))[1] & 0xf) == 0x8))
+
+#define IN6_IS_ADDR_MC_GLOBAL(a) \
+    (IN6_IS_ADDR_MULTICAST(a)                          \
+     && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe))
+#endif
 
 #include <config.h>
 
diff --git a/glib-2.28.1/configure.ac b/aglib-2.28.1/configure.ac
index 08aeee7..7d60325 100644
--- a/glib-2.28.1/configure.ac
+++ b/aglib-2.28.1/configure.ac
@@ -852,7 +852,10 @@ fi
 
 
 # check for header files
-AC_CHECK_HEADERS([dirent.h float.h limits.h pwd.h grp.h sys/param.h sys/poll.h sys/resource.h])
+if test "$ac_cv_android_arm" != "yes"; then
+    AC_CHECK_HEADERS([pwd.h])
+fi
+AC_CHECK_HEADERS([dirent.h float.h limits.h grp.h sys/param.h sys/poll.h sys/resource.h])
 AC_CHECK_HEADERS([sys/time.h sys/times.h sys/wait.h unistd.h values.h])
 AC_CHECK_HEADERS([sys/select.h sys/types.h stdint.h inttypes.h sched.h malloc.h])
 AC_CHECK_HEADERS([sys/vfs.h sys/mount.h sys/vmount.h sys/statfs.h sys/statvfs.h])
@@ -990,8 +993,10 @@ AC_CHECK_HEADERS([netdb.h wspiapi.h])
 
 # For gio/libasyncns
 if test $glib_native_win32 = no; then
-  AC_CHECK_FUNCS(strndup setresuid setreuid)
-  AC_CHECK_HEADERS(sys/prctl.h arpa/nameser_compat.h)
+    AC_CHECK_FUNCS(strndup setresuid setreuid)
+    if test "$ac_cv_android_arm" != "yes"; then
+	AC_CHECK_HEADERS(sys/prctl.h arpa/nameser_compat.h)
+    fi
 
   # We can't just use AC_CHECK_FUNC/AC_CHECK_LIB here. Bug 586150
   AC_MSG_CHECKING([for res_query])
@@ -2329,8 +2334,12 @@ fi
 #  b) FreeBSD doesn't do this either.
 #
 case $host in
-  *-*-freebsd*|*-*-linux*)
-    G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
+    *-*-freebsd*|*-*-linux*)
+    if test "$ac_cv_android_arm" != "yes"; then
+	G_THREAD_LIBS_FOR_GTHREAD="`echo $G_THREAD_LIBS | sed s/-pthread/-lpthread/`"
+    else 
+	CFLAGS="$CFLAGS -mno-thumb"
+    fi
     ;;
   *) 	 
     G_THREAD_LIBS_FOR_GTHREAD="$G_THREAD_LIBS" 	 
diff --git a/glib-2.28.1/m4macros/glib-gettext.m4 b/aglib-2.28.1/m4macros/glib-gettext.m4
index 77aa9f6..386b901 100644
--- a/glib-2.28.1/m4macros/glib-gettext.m4
+++ b/aglib-2.28.1/m4macros/glib-gettext.m4
@@ -252,7 +252,7 @@ msgstr ""
       fi
     ])
 
-    if test "$gt_cv_have_gettext" = "yes" ; then
+    if test "$gt_cv_have_gettext" = "yes" && test "$ac_cv_android_arm" != "yes"; then
       AC_DEFINE(ENABLE_NLS, 1,
         [always defined to indicate that i18n is enabled])
     fi
