get unique call details from CallLog - android

I am trying to access call logs in android application , here i am getting all call details but i want unique call details only , i don't want repeated values.
is there any way to get unique call log details in android ?

Get all call details and add them in Set. Set does not allow dupes.
Idea and guess:
If you are extracting each detail differently you might find easier to use Map and then add the keySet() to the Set data and then again you populate the map.
Remember in CallLog you might find same key (let's say Contact name) but different data for that call (Time, duration etc etc).

Related

Firebase - How to order items?

I'm trying to make a very simple list-based android app.
Is there a easy way to order objects and sort them by date?
My goal is to show the last added item on top of the list.
I've already tried with a client-side solution but it's not efficient.
At the moment i'm using this json data model:
{
id:"",
name:"",
body:"",
date:"date here"
}
Does anyone have and idea on how to solve this?
You must must use orderedByChild by the key of the date you'd like to order the children by. You can then observe the Value or ChildAdded event type of this query to retrieve the children in ascending order of date. To have the most recent first, you must reverse the objects manually client-side. Otherwise, you could prepend a - symbol to all the dates and handle it client side.

Youtube Channel List Api - not returning data in order

I am trying to do a simple Youtube Subcriber app.
When i try to send the user id , the returned result doesn't match the order i sent .
This is the api i am using
https://www.googleapis.com/youtube/v3/channels?part=statistics,brandingSettings,snippet&key=XXXXXXXXXXXXXXX&id=UCqIqRzEge-Qvt4Iglx-uKdQ,UC6bA7BuUmGKPIS3wW2voNxg,UC9JgYaC76Q_eSgYM01S5J_w,UCgefQJC5UgbWJHDxBqB4qVg,UCddiUEpeqJcYeBxX1IVBKvQ,UCOmcA3f_RrH6b9NmcNa4tdg
For example , i sent the data in this order
The Verge
Cnet
BfvsGf
The data returns :
BfvsGf
TheVerge
Cnet
It's not in order at all. Please advice.
Use Search:list, it returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, [channel](https://developers.google.com/youtube/v3/docs/channels) and playlist resources but you ca also configure queries to only retrieve a specific type of resource.
HTTP request
GET https://www.googleapis.com/youtube/v3/search
include the order parameter, the parameter specifies the method that will be used to order resources in the API response.
You can sort list by descending order, sort from highest to lowest rating or sorted by alphabetically. The acceptable values are: date, rating, relevance, title, videoCount, viewCount. The 'order' parameter will sort results based on when the resources were created.

How to get the particular value from the response message and assign it to another variable in the next request in Jmeter?

I am trying to make a performance testing process by using the Jmeter for the mobile chat application. The scenario i am trying is,need to analyze the output during the N number of new user registration process.I am feeding the N user data through "CSV Data Set Config".In that mentioned the variable names as "phone,ime".
For each new user registration process,the application will generate the one time password when calling the API1.The question is,I need to get that generated one time password from the API1 response message for each phone user and need to assign the value to the variable ${code} when calling the API2.
The below are the API & parameters details:
API1:/api/users/registration-sms.html?
1) Name:phone, Value: ${phone}
2) Name:ime, Value: ${ime}
Example :
Request - POST data: phone=917010370002 & ime=e78b56418b55b32c
Response:{"response":{"httpCode":200,"Message":"True","Code":"5858"}}
API2: /api/users/registration-sms-verfy.html?
1) Name:phone, Value:${phone}
2) Name:code, Value:${code}
Note : For this variable ${code},We need to get the data from the API1("Code":"5858") response message for the respective phone(917010370002).
Please provide me the feasible solution to sort out of my requirement.
Thanks in advance.
You can use Regular extractor post processor like,
Assuming your response is like
{"response":{"httpCode":200,"Message":"True","Code":"5858"}}
your regular expression will be like to extract code value but for specifiic phone no you need to modify it a little bit,
"Code"\:"(\d+)"
for occurance detail you can provide which match no. you want.
Refer Regular Expression Exctrator Post Processor

Implementing OR Condition using Parse Android SDK?

I am new to Parse and i am working on a Project that uses Android PARSE Sdk so i was wondering on how can i make a where query with or condition using the android sdk.
I want to make a query like this [Psuedo code]
Select * from employ where employId is ("1","2","3")
I found this on parse documentation, i don't know if it helps or not.
Edit:
This is what i found on PARSE but its not working
String[] id= {"1","2","3"};
query.whereContainedIn("employId ", Arrays.asList(id));
It returns me an empty list but if i query them one by one i get result... Can anyone tell me whats wrong ?
You can use whereContainedIn to select specific rows. See this post you can get more ideas. https://www.parse.com/questions/different-arrays-and-wherecontainedin-for-android.
List<String> employId = new ArrayList<String>();
employId.add("1"); employId.add("2"); employId.add("2");
query.whereContainedIn("employId", employId);
If you are still not clear. check this https://www.parse.com/docs/android_guide#queries
I have found the solution and i must say its pretty lame of PARSE to not mention this anywhere in there documentation.
The problem was that the values that i was using inwhereContainedIn method were of type String but in reality they were pointers to another table's row.
I was trying to get the values using only there ids[as it is displayed on parse] but instead i had to pass the whole object in order to retrieve them. That was the reason on why it was returning empty list.
The thing is Even though it displays IDs [pointer to object in a table] we cant search using only ID's instead we have to use complete Parse objects if we want to search a table based on Specific Object.

Android: How to getNetworkOperatorName and location from incomming/outgoing number?

I am Developing a simple application on CallLog.Calls. I am also following Calllog.Calls .I am Getting all the call details like.. callername , caller number , calltime , duration..etc. As per the requirement I need to check the unknown number location/caller networkprovidername like TruecallerApp and like this image
In short I want to know how can i get or trace the Caller Locationprovidername from the incomming/outgoing number in android programatically ???Is there any database i need to create with all the related data or any other way to solve this?? By using telephonymanager.getNetworkOperatorName() i can get the own device operator name similliraly i want to get for other number. Any Idea Please Rply soon .
Thank you :)

Categories

Resources