Language issue in android studio - android

I get bellow response in android studio using volley library
{"result":"[{\"TotalArea\":\"0.08\",\"OwnerName\":\"গিয়াসà§à¦¦à§à¦¦à¦¿à¦¨ .\",\"OwnerType\":\"বà§à¦¯à¦¾à¦•à§à¦¤à¦¿\",\"Address\":\"বিলাইমারী \",\"GurdianName\":\"সেখ নজর\",\"KhatianCreationDate\":\"not\",\"NoOfPlots\":\"1\",\"ERROR\":\"1\",\"TENANT_DETAIL\":[]}]","message":"Success"}
but originally it is bangla language
below is postman resposne
{
"result": "[{\"TotalArea\":\"0.9572\",\"OwnerName\":\"জ্যোতি প্রকাশ ঘোষ\",\"OwnerType\":\"ব্যাক্তি\",\"Address\":\"চাংড়ী পোতা থানা-সোনারপুর \",\"GurdianName\":\"রাজেন্দ্র ঘোষ\",\"KhatianCreationDate\":\"not\",\"NoOfPlots\":\"22\",\"ERROR\":\"1\",\"TENANT_DETAIL\":[]}]",
"message": "Success"
}

Related

Google Drive Api v3 upload to sharedDrive not working even with supportsAllDrives=true

I am trying to upload an image to a folder in Shared Drive. I managed to do that on My Drive but when I am trying to achieve this to the Shared Drive I get the following error:
{
"error": {
"code": 404,
"message": "File not found: 1ZQuuXVDx3I5rs6OnH8WvbWfo6HplnfW8.",
"errors": [
{
"locationType": "parameter",
"domain": "global",
"message": "File not found: 1ZQuuXVDx3I5rs6OnH8WvbWfo6HplnfW8.",
"reason": "notFound",
"location": "fileId"
}
]
}
}
This drives me nuts right now because I've read the documentation many times and I cannot find the solution. I have tried on the Android with Retrofit, on Postman and even on OAuth2 Playground that is provided by Google.
The request is this one, copy pasted from the OAuth2 Playground:
POST /upload/drive/v3/files?uploadType=multipart HTTP/1.1
Host: www.googleapis.com
Content-length: 50295
Content-type: multipart/related; boundary="===============323232404548=="
Authorization: Bearer ya29.a0AfH6SMBHmEo0Q9-8dXhhCY7wGrTj9PsFTCd0YUdLtyGJSfdO
--===============323232404548==
Content-type: application/json
{
"supportsAllDrives": true,
"driveId":"0APRAdsf3Sdfsk9PVA",
"name":"test.jpeg",
"parents":[
"1ZQuuXVDx3I5rs6OnH8WvbWfo6HplnfW8"
]
}
--===============323232404548==
Content-type: image/jpeg
What exactly is the problem? I have tried also using the driveId and the supportsAllDrives to the header of the request.
Any help is really appreciated. Links that I followed:
https://developers.google.com/drive/api/v3/manage-uploads#multipart and https://developers.google.com/drive/api/v3/reference/files/create
As indicated in the document, supportsAllDrives is a query parameter. Which means that it should be included in the URI and not in the request body.
From:
https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart
To:
https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&supportsAllDrives=true
If supportsAllDrives is not included in the query parameters, the default value would be false. This causes your response to have "File not found" message since it wasn't able to find or access the shared drive.

How to integrate Android App to Identity Server with ASP.NET Core 3.1 for Authentication?

I have created ASP.NET Core project with Angular Template with authentication using visual studio. Now I am developing Android App and want to integrate it with my existing ASP.NET CORE 3.1 WEB API (Backend).
I have added client in appsettings.json for my android app as follow:
"IdentityServer": {
"Clients": {
"MyAngularApp": {
"Profile": "IdentityServerSPA"
},
"MyMobileApp": {
"Profile": "NativeApp"
}
}
}
When I call my configuration endpoint "https://localhost:4042/_configuration/MyMobileApp", I got the following response;
{"authority":"https://localhost:4042","client_id":"MyMobileApp","redirect_uri":"urn:ietf:wg:oauth:2.0:oob","post_logout_redirect_uri":"urn:ietf:wg:oauth:2.0:oob","response_type":"code","scope":"offline_access MyAppAPI openid profile"}
I have the following Question;
what does "urn:ietf:wg:oauth:2.0:oob" means in the redirect_uri?
When I added redirect_uri in client settings like this,
"MyMobileApp": {"Profile": "NativeApp","RedirectUri": "com.example.myapplication"}
but I didn't get my defined redirect_uri when I call the endpoint
"https://localhost:4042/_configuration/MyMobileApp", In response I got this
"redirect_uri":"urn:ietf:wg:oauth:2.0:oob". So, how can I change the default RedirectUri?
I am using AppAuth library in Android for integrating with Identity Server.
In appsetting.json try you have to IdentityServer - Clients try this may be your issue will be resolve
"IdentityServer": {
"IssuerUri": "urn:sso.company.com",
"Clients": [
{
"Enabled": true,
"ClientId": "local-dev",
"ClientName": "Local Development",
"ClientSecrets": [ { "Value": "<Insert Sha256 hash of the secret encoded as Base64 string>" } ],
"AllowedGrantTypes": [ "implicit" ],
"AllowedScopes": [ "openid", "profile" ],
"RedirectUris": [ "https://localhost:5001/signin-oidc" ],
"RequireConsent": false
}
]
}

Ionic push - GCM_INVALID_AUTH

I'm developing an Ionic (version 1.3.1) application and trying use Ionic push.
The application is correctly registering to ionic server but I still don't receive any notification in my device. The only error I get is the below notification status:
{
"notification": "808cde89-eb21-40d7-9999-b86e5f86f1d3",
"token": {
"type": "android",
"token": "dkYxYGcKeNo:APA91bE4OXhzkOUOSF1EsXxgY9Cd0Uu9-A98Ak5prdMIGUd10tLljacgKs7zAp1WPLF-bDiy3pkdroc9l8vWy4sXdfansr56-rIF59wJfR1e7EibJZHFO5DFxCThpT_ZgVn_T_0n8an1",
"id": "ea40d3bc7561cc4f0d28ac49ce87fd3a",
"app_id": "7ab91503",
"invalidated": null,
"created": "2016-09-17T11:31:53.481151+00:00",
"valid": true
},
"uuid": "0ebe9454-aebc-4c0b-b5b0-056920817f56",
"status": "error",
"error": "GCM_INVALID_AUTH",
"created": "2016-09-17T14:31:20.517783+00:00",
"user_id": null
}
I'm supposing ionic server is not sending the notification to device as the status is error, but I don't know the reason why I'm getting this GCM_INVALID_AUTH error. What could cause this problem?
You need migrate your project from GCM to FCM (firebase cloud message) , and use new server key.
SOLVED
I was using the wrong credentials from Google Cloud Platform. When I set to server key the problem was solved.

Open Graph FB Authentication not returning valid token in Android

I'm working on a facebook login and trying to log in. Clicking a LoginButton gives me a prompt to log in with facebook, but oncomplete does not return a valid token.
I have attached the error:
The main idea: The App_id in the input_token did not match the Viewing App
I/AuthChimeraService: Error description received from server: {
"error": { "errors": [ { "domain": "global", "reason": "invalid",
"message": "Unsuccessful debug_token response from Facebook:
{\"error\":{\"message\":\"(#100) The App_id in the input_token did not
match the Viewing
App\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"GWc2S2d1RWT\"}}"
} ], "code": 400, "message": "Unsuccessful debug_token response from
Facebook: {\"error\":{\"message\":\"(#100) The App_id in the
input_token did not match the Viewing
App\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"GWc2S2d1RWT\"}}"
} }
https://medium.com/#puthnith/firebase-for-ios-invalid-api-key-cdde76ff92c4
This solved my problem.
Goto Firebase -> Project Settings -> Add firebase to your iOS App(If there is no iOS App added).
Download the GoogleService-Info.plist and into your iOS project just below Info.plist on the root of Xcode Project.

Appcelerator Push Notification error on Android only

Titanium version: 3.1.3.
I'm still using MQTT for Android and everything worked fine until a few weeks ago (maybe until mqtt on acs got deprecated). But I read that it is possible to still use MQTT (instead of gcm). According to another post on appcelerator I just had to define mqtt in the tiapp.xml, but this does not work.
This is part of my tiapp.xml
<property name="acs-push-type-development" type="string">mqtt</property>
<property name="acs-push-type-production" type="string">mqtt</property>
<property name="acs-push-type" type="string">mqtt</property>
...
<module platform="android" version="2.3.2">ti.cloudpush</module>
<module platform="android" version="2.1.2">ti.map</module>
<module platform="commonjs" version="2.3.7">ti.cloud</module>
That is what I get from the appcelerator logs:
`"response": {"push_log_details": [
{
"created_at": "2014-05-12T13:02:35.389Z",
"updated_at": "2014-05-12T13:02:31.094Z",
"type": "android",
"android_type": 1,
"app_id": "52724d7cd72ec85152039256",
"channel": "stickin",
"_id": "5370c66be511ea7ab99881d4",
"token": "ND1M2IX8RU8RGJDICW13I9V",
"push_id": "5370c6641316e90db2311567",
"send_status": 2,
"sent_at": "2014-05-12T13:02:30.996Z",
"error_message": "argument cannot be null",
"msg_id": "fa89cfb6-f2d2-4222-b442-a47d2625b419"
},
{
"created_at": "2014-05-12T13:02:35.389Z",
"updated_at": "2014-05-12T13:02:31.094Z",
"type": "android",
"android_type": 1,
"app_id": "52724d7cd72ec85152039256",
"channel": "stickin",
"_id": "5370c66be511ea7ab99881d6",
"token": "ND13ST3OA0MHE079H6EYV8P",
"push_id": "5370c6641316e90db2311567",
"send_status": 2,
"sent_at": "2014-05-12T13:02:30.996Z",
"error_message": "argument cannot be null",
"msg_id": "77fc5c7f-9703-46e5-a433-7be0796421f2"
}, .....
`
"argument cannot be null" seems like a gcm response code. I tried removing apiKey and sender id of gcm and to only save the Application Packagename (MQTT), but then I get the error gcm_apiKey is null. I thought push is not using gcm if I define mqtt in the tiapp.xml? By the way, on iOS everything is working fine, but of course mqtt is not used there.
Check the following
CloudPush module version you are using should be below 3.2.0
You should specify 'android' as type while subscribing to the push notification. (in the case of GCM, you have to use 'gcm')
However Appcelerator has removed the MQTT support from March 15th 2014..
So latest CloudPush modules will not support MQTT anymore.
See the below screenshot. You may see this on the ACS server. You need to upgrade your app to GCM to fix the issues and upgrading to GCM is pretty simple. I had already done it earlier. I suggest you should upgrade your app to GCM support.
Also visit Android Push Notification: Deprecating MQTT in favor of GCM in Appcelerator Blog.

Categories

Resources