Android identifying phone number

How to find your own phone number on iOS or Android

Gone are the days when phone numbers were as commonly memorized as street addresses. While you once had your own phone number, your best friend’s, your crush’s, and the one for the local pizza shop all at the top of mind, the advent of smartphones has rendered this memory exercise moot. Like most people, you probably don’t call your own phone number very often — and if you do, it’s likely listed in your Favorites — so you may not know it off the top of your head.

With that reality comes the familiar grip of panic when a new acquaintance asks for your mobile phone number and you have no clue. Or maybe you’re so used to sharing your second phone number that you forgot the first!

Don’t worry, you’re not alone. Regardless of whether you’re using an iOS or Android device, you can quickly locate your own number (among other details like your IMEI number) on your phone if you know where to look. We’ll show you how to do it.

How to find your phone number in iOS

Looking up your phone number on an iOS device is easy and convenient because most iOS users are running the same version. There are two ways you can easily locate your phone number: The Contacts app or in the settings.

  • Contacts: Open the Phone app, tap Contacts, and your number will be the first listed.
  • Settings: Go to Settings > Phone and My Number will be the first field on the list. You can of course change, or edit, this if you wish by tapping on the number.

How to find your phone number in Android

Do not be surprised to discover some variations in the steps you need to take for finding your own mobile number on an Android device. That’s because Android users may be running different versions of the operating system and because of variations in how the operating system is implemented across device brands. So there are bound to be different interfaces depending on which device you use and which version of the OS you run. Generally, however, all roads begin from the settings.

The example below is on an LG V40 ThinQ running Android 10, but the process remains the same in Android 11 and Android 12.

  • Go to settings and search for My phone number in the search bar.
  • The result will give you the path: System > About phone > Status.
  • Alternately, launch the Contacts app and you’ll see your own contact info right at the top.

The screenshots below show an older Samsung Galaxy S6 that runs Android 6.0 Marshmallow.

If you’re running stock Android, or something very close — for example, the Google Pixel or Nexus, or the Lenovo Moto G, X, or Z smartphones — pull up the Contacts app. You’ll see an entry titled My Info or Me ; your phone number is listed in that contact information at the top of the list.

Читайте также:  1 din автомагнитола android gps с выдвижным экраном

For every Android phone, regardless of manufacturer, you’ll be able to find your phone number if you go to Settings > About Phone or About Device > Status > My phone number . Some Android phones will have SIM or SIM card status listed within Status . If this is the case with your phone, then your number will be listed there. If you don’t want to go through these many different menus, you can pull up the search bar and type in My Phone Number to directly pull up the relevant information.

It’s not hard to find your phone number once you know how to look for it, so you can help others find their numbers with just a few steps.

Getting a call from your own number?

Now that you’ve found or memorized your phone number, it might come as a shock to see if pop-up on your screen as an incoming call. The FTC has warned that some robocallers and scammers have taken number spoofing to the next level and will use your own number in hopes you answer. They have also taken to this method to get around number block, because after all, who blocks their own number? If you see an incoming call with your number on it, no it’s not you from an alternate timeline, it’s a scam so don’t pick up.

Источник

Основы Contacts API в Android

Введение

Начиная с версии 5 API Android SDK интерфейс работы с контактами изменился, а основной контент провайдер Contacts и все его составляющие получили черную метку @Deprecated. Теперь за работу с контактами отвечает провайдер ContactsContract. Эти изменения связаны с изменением структуры хранения контактов, более адаптированной для Android устройств, которым требуется хранить контакты из множества разных источников и предоставлять их пользователю как единую сущность. Ведь сегодня, определенный контакт на нашем мобильном устройстве это не только имя и номер телефона, мы можем захотеть сохранить eMail, Im, Twitter, Facebook аккаунт определенного человека, и при этом, мы не хотим чтобы у нас нас появилось миллион непонятных записей. Поэтому новый Contacts API позволяет Android агрегировать похожие контакты и представлять их пользователю в одной записи, а также связывать контакт с разного рода данными.

Структура данных

На устройстве основная информация о контактах хранится в трех таблицах, на деле их там конечно больше, но мы рассмотрим основные три: contacts, raw_contacts и data. Чтобы было более наглядно я набросал простую схему в Dia.

В таблице contacts хранятся агрегированные контакты, каждая запись в этой таблице представляет собой пользовательский контакт (единую сущность) – объединение одного или нескольких сырых (необработанных) контактов из таблицы raw_contacts. Как видно на схеме, связь между этими таблицами один ко многим (1-N). Одна запись в таблице raw_contacts представляет собой так называемый сырой контакт. Сырой контакт, на языке Android, означает какой-то конкретный набор данных для определенного контакта. Но сами основные данные в этой таблице не хранятся, они хранятся в таблице data, и связь между raw_contacts и data также один ко многим. В таблице data хранятся непосредственно данные. Причем каждая строка этой таблицы это набор данных определенного типа для контакта. Какого именно типа данные хранятся в строке определяется столбцом mimetype_id, в котором содержится id типов данных определенных в таблице mimetype(например vnd.android.cursor.item/name, vnd.android.cursor.item/photo). Теперь разберемся во всем по подробней и с примерами.

Читайте также:  Драйверы intel для android

Работаем с контактами

Хорошо, допустим мы хотим добавить контакт (Robert Smith, моб.тел. 11-22-33), как нам это сделать? В таблицу contacts мы сами, явно, не можем добавить контакт, так как система сама формирует эту таблицу агрегируя похожие raw_contacts. Идентичность контактов система определяет в основном по имени (одинаковые имена, фамилии и т.п.), но и по другим критериям, каким именно и как ими управлять можно посмотреть в документации. То есть, если мы добавим raw_contact нашего Роберта (Robert Smith) и свяжем его с данными типа vnd.cursor.android.item/phone, а потом у нас появится “похожий”, для системы, Robert Smith связанный с данными типа vnd.cursor.android.item/email и еще один с данными типа vnd.cursor.android.item/photo, то у нас в контактах будет один Robert Smith с фотографией, мобильным и email’ом.

Теперь попробуем переложить это на код. За таблицы и их поля отвечает, как я уже говорил, класс ContactsContract и его внутренние классы и интерфейсы. Например интерфейсом к таблице raw_contacts является класс ContactsContract.RawContacts, а за таблицу data класс ContactsContract.Data. Будьте внимательны когда изучаете их константы – интерфейсы к столбцам – обращайте внимание на метки read/write и read only.

Из написанного выше следует, что для начала, мы должны добавить сырой контакт, а потом связывать его с данными. Добавить пустой контакт можно так:

В контактах у вас должен появиться пустой (Unknown) контакт, ни с чем не связанный. Добавим ему имя. Чтобы это сделать, мы должны связать наш новый контакт с новыми данными используя его id, который можно достать из прошлого запроса. Основные интерфейсы к полям таблицы данных содержаться в классе-контейнере ContactsContract.CommonDataKinds и его внутренних классах и интерфейсах. Например, сейчас нам понадобиться
класс ContactsContract.CommonDataKinds.StrucruredName содержащий нужные нам константы для добавления имени, а также константу MIME типа, которой мы пометим наше поле в таблице данных.

Если мы добавим контакт таким образом, то в списке контактов у нас появиться Robert Smith. Теперь идем дальше, добавим нашему контакту еще и телефон. Для этого нам понадобиться класс ContactsContract.CommonDataKinds.Phone, который является интерфейсом к данным телефонного номера.

Теперь в контактах у нас есть Robert Smith которому можно позвонить. Но вот так добавлять контакт и данные к нему, в несколько запросов, дорого и накладно. Поэтому существует класс ContentProviderOperation, который позволяет построить запрос, который выполнит все наши операции за одну транзакцию. Именно им и рекомендуют пользоваться. Вот так можно добавить нашего Роберта используя ContentProviderOperation.

Вот таким образом в Android можно добавлять контакты. Будьте осторожны используя ContentProviderOperation, так как слишком большой запрос может долго выполняться. Вообще все операции лучше производить в отдельном потоке, потому, что у пользователя, например, может быть слабый телефон и много контактов.

В остальном все другие операции выполняются обычным образом, используя те провайдеры, которые вам необходимы, с некоторыми оговорками. Например, удаление контакта из таблицы contacts удалит все raw_contacts с ним связанные и т.д.

Читайте также:  Архив чатов whatsapp андроид

Вот так можно попробовать найти нашего Роберта в контактах:

На этом хотелось бы завершить статью, все же это были только основные сведения о Contacts API в Andoid. Я надеюсь мне удалось описать здесь основные принципы, а вся конкретика зависит от того, что вам необходимо сделать в процессе работы. Можно просто руководствоваться этими принципами и находить в официальной документации интерфейсы которые вам нужны для работы. Успехов!

Источник

How to Get Your Mobile Number from Your SIM

This article was co-authored by wikiHow Staff. Our trained team of editors and researchers validate articles for accuracy and comprehensiveness. wikiHow’s Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards.

This article has been viewed 1,157,045 times.

This step-by-step guide teaches you how to find the phone number that’s connected to a SIM card no matter what kind of phone you have.

I edited this screenshot of an Android icon.\n

\u00a9 2021 wikiHow, Inc. All rights reserved. wikiHow, Inc. is the copyright holder of this image under U.S. and international copyright laws. This image is not licensed under the Creative Commons license applied to text content and some other images posted to the wikiHow website. This image may not be used by other entities without the express written consent of wikiHow, Inc.
\n

\u00a9 2021 wikiHow, Inc. All rights reserved. wikiHow, Inc. is the copyright holder of this image under U.S. and international copyright laws. This image is not licensed under the Creative Commons license applied to text content and some other images posted to the wikiHow website. This image may not be used by other entities without the express written consent of wikiHow, Inc.
\n

\u00a9 2021 wikiHow, Inc. All rights reserved. wikiHow, Inc. is the copyright holder of this image under U.S. and international copyright laws. This image is not licensed under the Creative Commons license applied to text content and some other images posted to the wikiHow website. This image may not be used by other entities without the express written consent of wikiHow, Inc.
\n

\u00a9 2021 wikiHow, Inc. All rights reserved. wikiHow, Inc. is the copyright holder of this image under U.S. and international copyright laws. This image is not licensed under the Creative Commons license applied to text content and some other images posted to the wikiHow website. This image may not be used by other entities without the express written consent of wikiHow, Inc.
\n

\u00a9 2021 wikiHow, Inc. All rights reserved. wikiHow, Inc. is the copyright holder of this image under U.S. and international copyright laws. This image is not licensed under the Creative Commons license applied to text content and some other images posted to the wikiHow website. This image may not be used by other entities without the express written consent of wikiHow, Inc.
\n

I edited this screenshot of an iPhone icon.\n

Источник

Оцените статью