aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/webapi
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 21:46:22 -0500
commita065e04d529da1d847b5062a12c46d916408bf32 (patch)
treefe0f8bcec1ff39a3c499a2708222dcf15224ff70 /files/pt-br/webapi
parent218934fa2ed1c702a6d3923d2aa2cc6b43c48684 (diff)
downloadtranslated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.gz
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.tar.bz2
translated-content-a065e04d529da1d847b5062a12c46d916408bf32.zip
update based on https://github.com/mdn/yari/issues/2028
Diffstat (limited to 'files/pt-br/webapi')
-rw-r--r--files/pt-br/webapi/device_storage/index.html224
-rw-r--r--files/pt-br/webapi/idle/index.html70
-rw-r--r--files/pt-br/webapi/mobile_connection/index.html148
-rw-r--r--files/pt-br/webapi/network_stats/index.html86
-rw-r--r--files/pt-br/webapi/tcp_socket/index.html75
-rw-r--r--files/pt-br/webapi/web_activities/index.html421
-rw-r--r--files/pt-br/webapi/websms/index.html136
7 files changed, 0 insertions, 1160 deletions
diff --git a/files/pt-br/webapi/device_storage/index.html b/files/pt-br/webapi/device_storage/index.html
deleted file mode 100644
index a50851ed77..0000000000
--- a/files/pt-br/webapi/device_storage/index.html
+++ /dev/null
@@ -1,224 +0,0 @@
----
-title: Device Storage API
-slug: WebAPI/Device_Storage
-translation_of: Archive/B2G_OS/API/Device_Storage_API
----
-<p>{{ non-standard_header() }}</p>
-<p><span style="line-height: 1.5;">{{ B2GOnlyHeader2('privileged') }}</span></p>
-<h2 id="Sumário">Sumário</h2>
-<p>O Device Storage API é utilizado para acessar o sistema via Web app. Como acessar arquivos do sistema é algo sensível, e por está razão que API só libera o acesso a leitura.</p>
-<div class="note">
- <p><strong>Nota:</strong> Acessar o storage do device é um pouco lento devido a limitação do nível físico. Em muitos casos pode ser mais rápido usar uma base de dados <a href="/en-US/docs/IndexedDB" title="/en-US/docs/IndexedDB">IndexedDB</a> em vez de armazenar os arquivos no storage do device.</p>
-</div>
-<h2 id="Acessando_um_storage">Acessando um storage</h2>
-<h3 id="Ponto_de_entrada">Ponto de entrada</h3>
-<p>É possível ter acesso a uma área de storage utilizando o método, {{domxref("window.navigator.getDeviceStorage()","navigator.getDeviceStorage()")}}. Este método aceita uma string como parâmetro que representa o nome do storage que você quer acessar. O método retorna um objeto {{domxref("DeviceStorage")}} que é utilizaod para ter acesso a leitura da área do storage.</p>
-<p>Firefox OS fornece as seguintes áreas de storage:</p>
-<ul>
- <li><code>apps</code>: Esta área de storage é reponsável por armazenar os apps. Como este dado é crítico, requer um previlégio extra, que só está disponível somente para apps certificadas.</li>
- <li><code>music</code>: Esta área de storage é responsável por armazenar as música e sons.</li>
- <li><code>pictures</code>: Esta área de storage é resposável por armazenas as imagens.</li>
- <li><code>sdcard</code>: Esta área de storage é responsável por dar acesso ao SDCard do device.</li>
- <li><code>videos</code>: Esta área de storage é responsável por armazenar os vídeos.</li>
-</ul>
-<pre class="brush: js">var pics = navigator.getDeviceStorage('pictures');</pre>
-<p>Para ser capaz de utilizar cada uma dessas áreas de storage, a app precisa solicitar no seu manifesto a permissão. Como examplo, se app precisa ter acesso a área de storage  <code>sdcard</code>, é necessário declarar a seguinte linha "<code>device-storage:sdcard</code>" para slolicitar a permissão, detro do arquivo de manifesto, conforme exemplo abaixo.</p>
-<pre class="brush: js">"permissions": {
- "device-storage:videos":{ "access": "readonly" },
- "device-storage:pictures":{ "access": "readwrite" }
-}</pre>
-<h2 id="Utilizando_um_storage">Utilizando um storage</h2>
-<p>Depois que uma app tem acesso a uma área de storage, ela pode adicionar, pegar e remover arquivos desta área.</p>
-<h3 id="Adicionar_um_arquivo">Adicionar um arquivo</h3>
-<p>Para adicionar um arquivo utilizamos os seguintes métodos {{domxref("DeviceStorage.addNamed()","addNamed")}} ou {{domxref("DeviceStorage.add()","add")}}. O primeiro método permite definir o nome do arquivo que está sendo adicionado e o segundo método gera o nome de forma automatica. Ambos os métodos são assíncronos e retorna um objeto {{domxref("DOMRequest")}} para controlar o <code>success</code> ou <code>error</code> da operação. Isto é muito importânte para acompanhar o processo de leitura e escrita de arquivos.</p>
-<p>Aqueles dois métodos espera um {{domxref("Blob")}} como o seu primeiro parametro. Este objeto será transformado em um arquivo e armazenado em background. Quando criar o objeto {{domxref("Blob")}}, é obrigado dar um <code>type</code>. Este <code>type</code>, que é o <span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">type </span>mime, é importânte porque algumas áreas storage tem base restrição o <span style="font-family: 'Courier New', 'Andale Mono', monospace; line-height: normal;">type:</span></p>
-<ul>
- <li><code>music</code> só aceita {{domxref("Blob")}} como um tipo mime de audio válido</li>
- <li><code>pictures</code> só aceita {{domxref("Blob")}} como um tipo mime de image válido</li>
- <li><code>videos</code> só aceita {{domxref("Blob")}} como um tipo mime de vídeo válido</li>
-</ul>
-<pre class="brush: js">var sdcard = navigator.getDeviceStorage("sdcard");
-var file = new Blob(["This is a text file."], {type: "text/plain"});
-
-var request = sdcard.addNamed(file, "my-file.txt");
-
-request.onsuccess = function () {
- var name = this.result;
- console.log('File "' + name + '" successfully wrote on the sdcard storage area');
-}
-
-// An error typically occur if a file with the same name already exist
-request.onerror = function () {
- console.warn('Unable to write the file: ' + this.error);
-}
-</pre>
-<div class="note">
- <p><strong>Nota:</strong> Repositória em uma área de storage são implícitos. Repository in a storage area are implicit. Não é possível criar explicidamente um repositório vazio.  Se você  Se você precisar de uma estrutura de repositório é necessário ter um arquivo armazenado. Então se você precisa armazenar um arquivo <code>bar</code> dentro do repositório <code>foo</code>, você tem que usar o método {{domxref("DeviceStorage.addNamed()","addNamed")}}  com o caminho compreto para o arquivo <code>addNamed(<em>blob</em>, "foo/bar")</code>. Isto também é utilzado quando você precisa recuperar um arquivo utilizando seu nome (veja abaixo).</p>
- <p>Como os arquivos são adicionados dentro de uma área de storage retrita, por razões de securança, o caminho do arquivo não pode começar com "<code>/</code>" ou "<code>../</code>" (e "<code>./</code>" é inútil).</p>
-</div>
-<h3 id="Download_de_um_arquivo">Download de um arquivo</h3>
-<p>Download de um arquivo pode ser feito de duas maneira: usando seu nome ou por interação em uma lista inteira.</p>
-<p>A maneira mais fácil de recuperar um arquivo é utiliznado o nome do arquivo nos métodos {{domxref("DeviceStorage.get()","get")}} e {{domxref("DeviceStorage.getEditable","getEditable")}}. O primeiro método retorna um objeto {{domxref("File")}} (que age só como uma leitura de arquivo) e o segundo retorna o objeto {{domxref("FileHandle")}} object (que permite alterar o arquivo base). Os dois métodos são assíncronos e returna um objeto {{domxref("DOMRequest")}} para manipular caso tenha <code>success</code> ou <code>error</code>.</p>
-<pre class="brush: js">var sdcard = navigator.getDeviceStorage('sdcard');
-
-var request = sdcard.get("my-file.txt");
-
-request.onsuccess = function () {
- var file = this.result;
- console.log("Get the file: " + file.name);
-}
-
-request.onerror = function () {
- console.warn("Unable to get the file: " + this.error);
-}
-</pre>
-<p>A outra maneira de recuperar arquivos é navegando pelo conteúdo da área de storage. Temos dois métodos {{domxref("DeviceStorage.enumerate()","enumerate")}} e{{domxref("DeviceStorage.enumerateEditable()","enumerateEditable")}}. O retorno do primeiro método é os objetos {{domxref("File")}} o segunto método retorna os objetos {{domxref("FileHandle")}} . Ambos métodos são assíncrono e retorna um objeto {{domxref("DOMCursor")}} para iterar ao longo da lista de arquivos. Um {{domxref("DOMCursor")}} é nada menos que um {{domxref("DOMRequest")}} com uma função a mais para interar de forma assíncrona ao longo de uma lista de coisas (arquivos nesse caso).</p>
-<pre class="brush: js">var pics = navigator.getDeviceStorage('pictures');
-
-// Let's browse all the images available
-var cursor = pics.enumerate();
-
-cursor.onsuccess = function () {
- var file = this.result;
- console.log("File found: " + file.name);
-
- // Once we found a file we check if there is other results
- if (!this.done) {
- // Then we move to the next result, which call the cursor
- // success with the next file as result.
- this.continue();
- }
-}
-
-cursor.onerror = function () {
- console.warn("No file found: " + this.error);
-}
-</pre>
-<p>É possível para limitar o número de resultados, passando dois parâmetros opcionais para os métodos {{domxref("DeviceStorage.enumerate()","enumerate")}} e {{domxref("DeviceStorage.enumerateEditable()","enumerateEditable")}}.</p>
-<p>O primeiro parâmetro pode ser uma string, que representa uma sub pasta para uma busca interna.</p>
-<p>O segundo parâmetro pode ser um objeto com uma propriedade <code>since</code>, que permite liberar a pesquisa por um determinado período de tempo.</p>
-<pre class="brush: js">var pics = navigator.getDeviceStorage('pictures');
-
-// Lets retrieve picture from the last week.
-var param = {
- since: new Date((+new Date()) - 7*24*60*60*1000)
-}
-
-var cursor = pics.enumerate(param);
-
-cursor.onsuccess = function () {
- var file = this.result;
- console.log("Picture taken on: " + file.<code class="language-js">lastModifiedDate</code>);
-
- if (!this.done) {
- this.continue();
- }
-}
-</pre>
-<h3 id="Deletar_um_arquivo">Deletar um arquivo</h3>
-<p>Um arquivo pode ser removido a partir da sua área de storage, simplismente utilizando o método {{domxref("DeviceStorage.delete()","delete")}}. Este método só precisa do nome para deletar o arquivo. Como todos os outros métodos da interface {{domxref("DeviceStorage")}}, este também é assíncrono e retorna um objeto {{domxref("DOMRequest")}} para manipular os status de <code>success</code> ou <code>error</code>.</p>
-<pre class="brush: js">var sdcard = navigator.getDeviceStorage('sdcard');
-
-var request = sdcard.delete("my-file.txt");
-
-request.onsuccess = function () {
- console.log("File deleted");
-}
-
-request.onerror = function () {
- console.log("Unable to delete the file: " + this.error);
-}
-</pre>
-<h2 id="Informação_do_Storage">Informação do Storage</h2>
-<p>Além de acessar os arquivos, a área de storage fornece alguns métodos para ler facilmente algumas informações importantes.</p>
-<p><span style="font-size: 24px; letter-spacing: -0.5px; line-height: 24px;">Estaço Livre</span></p>
-<p>Uma das mais umportantes informações para saber sobre o storage, é a quantidade de espaço livre para armazenamento. A interface {{domxref("DeviceStorage")}} fornece duas funções úteis dedicada ao espaço de armazenamento:</p>
-<ul>
- <li>{{domxref("DeviceStorage.freeSpace()","freeSpace()")}} para pegar a quantidade de espaço livre disponível para armazenar novos arquivos;</li>
- <li>{{domxref("DeviceStorage.freeSpace()","usedSpace()")}} para pegar a quantidade de espaço usado pelos arquivos armazenados;</li>
-</ul>
-<p>Como os dois métodos são assíncronos, eles retornam um objeto {{domxref("DOMRequest")}} para tratar os status de <code>success</code> ou <code>error</code>.</p>
-<pre class="brush: js">var videos = navigator.getDeviceStorage('videos');
-
-var request = videos.usedSpace();
-
-request.onsuccess = function () {
- // The result is express in bytes, lets turn it into megabytes
- var size = this.result / 1048576;
- console.log("The videos on your device use a total of " + size.toFixed(2) + "Mo of space.");
-}
-
-request.onerror = function () {
- console.warn("Unable to get the space used by videos: " + this.error);
-}
-</pre>
-<h3 id="Ouvindo_alterações">Ouvindo alterações</h3>
-<p>Como muitas aplicações pode usar uma mesma área de storage ao mesmo tempo, por este motivo é muito útil para aplicação estar ciente de uma alteração em uma área de storage. É também útil para uma aplição que deseja executar uma ação assíncrona sem a dependência do objeto de retorno {{domxref("DOMRequest")}} por cada método da interface  {{domxref("DeviceStorage")}}.</p>
-<p>Para esse fim, um evento {{event("change")}} é acionado cada vez que um arquivo é criado, modificado ou deletado. Este evento pode ser capturado utilizando a propriedade  {{domxref("DeviceStorage.onchange","onchange")}} ou o método {{domxref("EventTarget.addEventListener()","addEventListener()")}}. O evento pega um objeto {{domxref("DeviceStorageChangeEvent")}} que um objeto regular {{domxref("Event")}} que tem duas própriedades não obrigatórias:</p>
-<ul>
- <li>{{domxref("DeviceStorageChangeEvent.reason")}} que informa a mudança em arquivos (<code>criados</code>, <code>modificados</code> orou <code>deletados</code>)</li>
- <li>{{domxref("DeviceStorageChangeEvent.path")}} que retorna o caminho completos para arquivos afetados pela mudança.</li>
-</ul>
-<pre class="brush: js">var sdcard = navigator.getDeviceStorage('sdcard');
-
-sdcard.onchange = function (change) {
- var reason = change.reason;
- var path = change.path;
-
- console.log('The file "' + path + '" has been ' + reason);
-}
-</pre>
-<h2 id="Especificação">Especificação</h2>
-<p>Não faz parte de qualquer especificação.</p>
-<h2 id="Compatibilidade_com_Browser">Compatibilidade com Browser</h2>
-<p>{{ CompatibilityTable() }}</p>
-<div id="compat-desktop">
- <table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- </tr>
- </tbody>
- </table>
-</div>
-<div id="compat-mobile">
- <table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Basic support</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatUnknown() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- </tr>
- </tbody>
- </table>
-</div>
-<h2 id="Veja_também">Veja também</h2>
-<ul>
- <li>{{domxref("window.navigator.getDeviceStorage()","navigator.getDeviceStorage()")}}</li>
- <li>{{domxref("DeviceStorage")}}</li>
- <li>{{domxref("DeviceStorageChangeEvent")}}</li>
-</ul>
diff --git a/files/pt-br/webapi/idle/index.html b/files/pt-br/webapi/idle/index.html
deleted file mode 100644
index 65f71e1b2c..0000000000
--- a/files/pt-br/webapi/idle/index.html
+++ /dev/null
@@ -1,70 +0,0 @@
----
-title: Idle API
-slug: WebAPI/Idle
-tags:
- - API
- - inatividade
- - observadores
-translation_of: Archive/B2G_OS/API/Idle_API
----
-<div>
- {{non-standard_header}} {{B2GOnlyHeader2('certified')}}</div>
-<h2 id="Resumo">Resumo</h2>
-<p>A Idle API é utilizada para enviar notificações ao usuário mesmo quando um aplicativo está em segundo plano (inativo). Ela possibilita que o usuário continue recebendo notificaçòes do aplicativo mesmo quando não estiver com ele em primeiro plano (ativo). O caso de uso mais comum é para economizar bateria; nesse caso é utilizado em conjunto com a <a href="/en-US/docs/WebAPI/Power_Management">Power Management API</a>, api de gerenciamento de energia.</p>
-<h2 id="Monitorando_uma_aplicação_inativa">Monitorando uma aplicação inativa</h2>
-<p>Para que uma aplicação em segundo plano envie notificações ao usuário, é necessário registrar um observador (idle observer).O observador é um objeto que possui três propriedades:</p>
-<ul>
- <li>A propriedade <code>time</code> define o tempo que será aguardado para a execução da propriedade <code>onidle</code>, após o aplicativo entrar em segundo plano. É definida em segundos.</li>
- <li>A propriedade <code>onidle</code> é chamada quando o apicativo entra em segundo plano.</li>
- <li>A propriedade <code>onactive</code> é chamada quando o aplicativo volta para o primeiro plano.</li>
-</ul>
-<h3 id="Exemplo_escurecendo_a_tela_to_celular_quando_o_app_estiver_inativo">Exemplo: escurecendo a tela to celular quando o app estiver inativo</h3>
-<p>In this example, an idle observer is set up that dims the screen's brightness to 50% when the user is idle for 10 seconds, and restores it back to 100% when the user is active again. A second observer is set up that turns off the screen when the user is idle for at least 15 seconds.</p>
-<p>Nesse exemplo, o observador está configurado para reduzir o brilho da tela em 50%, 10 segundos após o aplicativo entrar em segundo plano, e restaura o brilho para 100% quando ele voltar a ficar em primeiro plano. Um segundo observador é configurado, e 15 segundos após o aplicativo entrar em segundo plano, ele apaga a tela do usuário.</p>
-<pre class="brush: js">// NOTE: mozPower is part of the Power Management API
-
-var fadeLight = {
- time: 10, // Ten seconds
-
- onidle: function () {
- // The user does not seem active, let's dim the screen down
- navigator.mozPower.screenBrightness = 0.5;
- },
-
- onactive: function () {
- // Ok, the user is back, let's brighten the screen up
- navigator.mozPower.screenBrightness = 1;
- }
-}
-
-var screenOff = {
- time: 15, // fifteen seconds
-
- onidle: function () {
- // Ok, the user had his chance but he's really idle, let's turn the screen off
- navigator.mozPower.screenEnabled = false;
- },
-
- onactive: function () {
- // Ok, the user is back, let's turn the screen on
- navigator.mozPower.screenEnabled = true;
- }
-}
-
-// Register the idle observers
-
-navigator.addIdleObserver(fadeLight);
-navigator.addIdleObserver(screenOff);
-</pre>
-<p>O código acima define 2 observadores: <code>fadeLight</code> e <code>screenOff</code>, que chamam {{domxref("window.navigator.addIdleObserver","navigator.addIdleObserver()")}} uma vez para cada um deles, de modo que eles sejam registrados. Podem ser registrados quantos observadores forem necessários para uma aplicação.</p>
-<p>Se não for necessário observar o momento em que o aplicativo entra em segundo plano, os observadores ociosos podem ser removidos chamando o método {{domxref("window.navigator.removeIdleObserver","navigator.removeIdleObserver()")}} , como mostrado a seguir:</p>
-<pre class="brush:js">navigator.removeIdleObserver(fadeLight);
-navigator.removeIdleObserver(screenOff);
-</pre>
-<h2 id="Especificação">Especificação</h2>
-<p>Essa API não faz parte das especificações do W3C, mas será discutida como parte do <a href="http://www.w3.org/2012/sysapps/" rel="external">System Applications Working Group</a>.</p>
-<h2 id="Veja_também">Veja também</h2>
-<ul>
- <li>{{domxref("window.navigator.addIdleObserver","navigator.addIdleObserver()")}}</li>
- <li>{{domxref("window.navigator.removeIdleObserver","navigator.removeIdleObserver()")}}</li>
-</ul>
diff --git a/files/pt-br/webapi/mobile_connection/index.html b/files/pt-br/webapi/mobile_connection/index.html
deleted file mode 100644
index cccbb5cd05..0000000000
--- a/files/pt-br/webapi/mobile_connection/index.html
+++ /dev/null
@@ -1,148 +0,0 @@
----
-title: Mobile Connection
-slug: WebAPI/Mobile_Connection
-translation_of: Archive/B2G_OS/API/Mobile_Connection_API
----
-<p>{{ non-standard_header() }}</p>
-<p>{{ B2GOnlyHeader2('certified') }}</p>
-<h2 id="Sumário">Sumário</h2>
-<p>Essa API tem 2 propósitos:</p>
-<ul>
- <li>Dar acesso a informações detalhadas sobre os estados atuais da conexão móvel do dispositivo</li>
- <li>Dar acesso a uma capacidade específica junto com ICC (o cartão SIM/RUIM)</li>
-</ul>
-<p>Como essa API pode acessar funcionalidades que podem ter um impacto no plano móvel assinado pelo usuário (algumas funcionalidades pode ter custo para utilizar ou causar danos ao ICC), é restrita para aplicações certificadas apenas.</p>
-<p>O ponto inicial principal dessa API é a propriedade {{domxref("window.navigator.mozMobileConnection","navigator.mozMobileConnection")}} que é uma instância da interface {{domxref("MozMobileConnection")}}.</p>
-<h2 id="Estado_da_conexão_móvel">Estado da conexão móvel</h2>
-<p>O estado da conexão móvel é dividida em dois: de um lado a conexão <code>voice</code>, do outro conexão  <code>data</code>. O dado relacionado a cada tipo de conexão é acessível através pelas propriedades {{domxref("MozMobileConnection.voice")}} e {{domxref("MozMobileConnection.data")}} que ambas retornarão o objeto {{domxref("MozMobileConnectionInfo")}}.</p>
-<p>Esses objetos permitem acesso a todas as informações relacionadas a qualidade da rede (<a href="/en-US/docs/DOM/MozMobileConnectionInfo.signalStrength" title="/en-US/docs/DOM/MozMobileConnectionInfo.signalStrength">signal strength</a>, <a href="/en-US/docs/DOM/MozMobileConnectionInfo.relSignalStrength" title="/en-US/docs/DOM/MozMobileConnectionInfo.relSignalStrength">quality of the signal</a>, posição das <a href="/en-US/docs/DOM/MozMobileConnectionInfo.cell" title="/en-US/docs/DOM/MozMobileConnectionInfo.cell">network's cells</a>, <a href="/en-US/docs/DOM/MozMobileConnectionInfo.emergencyCallsOnly" title="/en-US/docs/DOM/MozMobileConnectionInfo.emergencyCallsOnly">restricted usage</a>, <a href="/en-US/docs/DOM/MozMobileConnectionInfo.roaming" title="/en-US/docs/DOM/MozMobileConnectionInfo.roaming">roaming</a>, etc.), e relacionado à  <a href="/en-US/docs/DOM/MozMobileConnectionInfo.network" title="/en-US/docs/DOM/MozMobileConnectionInfo.network">the carrier operating the network</a>.</p>
-<pre class="brush: js">var cnx = navigator.mozMobileConnection;
-
-console.log("The voice operator is " + cnx.voice.network.longName);
-
-if (cnx.voice.connected) {
- console.log("The signal has a strength of " + (+cnx.voice.relSignalStrength) + "%");
-} else {
- console.log("The state of the connection is: " + cnx.voice.state);
-}
-</pre>
-<h2 id="Funcionalidades_ICC">Funcionalidades ICC</h2>
-<p>As funcionalidades disponíveis para o ICC pode ser dividida dentro de duas categorias: o gerenciamento do próprio ICC e a utilização do comando integrado disponível dentro do <a href="http://en.wikipedia.org/wiki/SIM_Application_Toolkit" title="http://en.wikipedia.org/wiki/SIM_Application_Toolkit">STK</a> (<em>SIM Application Toolkit</em>).</p>
-<h3 id="Ações_Básicas">Ações Básicas</h3>
-<p>O {{domxref("MozMobileConnection")}} fornece métodos para lidar com comportamentos comuns no ICCs.</p>
-<div class="note">
- <p><strong>Nota:</strong> All original methods from the <code>MozMobileConnection</code> interface are fully asynchronous. They all return a {{domxref("DOMRequest")}} object which has an <code>onsuccess</code> and <code>onerror</code> event handler to handle the success or failure of the method call.</p>
-</div>
-<h4 id="Bloqueio_do_Cartão">Bloqueio do Cartão</h4>
-<p>Enquanto o cartão estiver bloqueado, o usuário é incapaz de utilizar uma rede móvel. É possível gerenciar o bloqueio do cartão com os métodos {{domxref("MozMobileConnection.getCardLock","getCardLock()")}}, {{domxref("MozMobileConnection.setCardLock","setCardLock()")}}, e {{domxref("MozMobileConnection.unlockCardLock","unlockCardLock()")}}.</p>
-<p>Se {{domxref("MozMobileConnection.getCardLock","getCardLock()")}} permite pegar algumas informações detalhadas sobre o bloqueio, também possível ter informação rápida sobre o bloqueio através {{domxref("MozMobileConnection.cardState")}} que retorna uma string representando o estado atual do bloqueio.</p>
-<div class="note">
- <p><strong>Nota:</strong> Even if the state change requests are successfully handled, it does not mean that the operations are necessarily successful. For that reason, any change in the card state is tracked independently through events:</p>
- <ul>
- <li>The {{event("icccardlockerror")}} event is triggered each time a call to {{domxref("MozMobileConnection.setCardLock","setCardLock()")}} or {{domxref("MozMobileConnection.unlockCardLock","unlockCardLock()")}} fails.</li>
- <li>The {{event("cardstatechange")}} event is triggered each time the {{domxref("MozMobileConnection.cardState","cardState")}} property changes.</li>
- </ul>
-</div>
-<pre class="brush: js">var cnx = navigator.mozMobileConnection;
-
-function unlockCard() {
- var unlockOptions = {
- lockType: "pin",
- pin : prompt("Please, enter your PIN")
- }
-
- var unlock = cnx.unlockCardLock(unlockOptions);
-
- unlock.onsuccess = function () {
- console.log("The card has successfully handled the PIN number.");
-
- if (this.result.success === false) {
- if (this.result.retryCount &gt; 0) {
- console.log("But you mistyped your PIN, you have " + this.result.retryCount + " tries left.");
- } else {
- console.log("But your card is hard locked, you need to contact your carrier to get a special unlocking code.");
- }
- }
- }
-
- unlock.onerror = function () {
- console.log("Hu! Something goes very wrong!")
- }
-}
-
-cnx.addEventListener('icccardlockerror', function () {
- // In case of error, ask the user for his PIN again
- unlockCard();
-});
-
-cnx.addEventListener('cardsatechange', function () {
- // In case the card state change and required to be unlocked
- if (cnx.cardState === 'pinRequired') {
- unlockCard();
- }
-}
-
-// First call to unlockCard if required
-if (cnx.cardState === 'pinRequired') {
- unlockCard();
-}
-</pre>
-<h4 id="Mensagens_MMI">Mensagens MMI</h4>
-<p><abbr title="Man Machine Interface">Mensagens MMI</abbr> são códigos legíveis para humanos que, uma vez digitado no teclado do aparelho, permite disparo de ações específicas do <a class="external" href="http://en.wikipedia.org/wiki/Radio_Interface_Layer" title="Wikipedia: Radio Interface Layer">RIL</a> ou pegar resposta da rede pela requisição<a class="external" href="http://en.wikipedia.org/wiki/USSD" title="Wikipedia: Unstructured Supplementary Service Data"> USSD</a>. Um exemplo comum é digitar um código curto para receber número <a href="http://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity" title="http://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity">IMEI</a> do aparelho.</p>
-<p>Essas mensagens são enviadas utilizando o método {{domxref("MozMobileConnection.sendMMI()")}} (e pode ser cancelado com {{domxref("MozMobileConnection.cancelMMI","cancelMMI()")}}). Mesmo com isso irá retornar um objeto {{domxref("DOMRequest")}}, a resposta para este tipo de mensagem é manuseada de duas maneiras:</p>
-<ul>
- <li>Se o código MMI necessita enviar uma requisição USSD, o <code>success </code>da requesição significa que o RIL foi processado com sucesso e enviou a requisição USSD para a rede. Porém, a resposta da rede é reportada através do evento {{event("ussdreceived")}}.</li>
- <li>Se o código MMI não for associado com o USSD mas com outra requisição RIL, seu resultado, se um for necessário, é enviado pelo retorno requisitado <code>success</code> ou <code>error</code>.</li>
-</ul>
-<pre class="brush: js">var cnx = navigator.mozMobileConnection;
-
-cnx.addEventHandler('ussdreceived', function (evt) {
- console.log('Network message: ' + evt.data.message);
-});
-
-var MMIRequest = cnx.sendMMI(prompt('Provide a valid MMI'));
-
-MMIRequest.onerror = function() {
- console.log("Mmmh... Something goes wrong.");
-}
-</pre>
-<h4 id="Opções_encaminhamento_de_chamada">Opções encaminhamento de chamada</h4>
-<p>Opções de encaminhamento permite definir como uma ligação pode ou não ser encaminhada para outro número de telefone.</p>
-<p>Essas opções são manuseadas com os métodos {{domxref("MozMobileConnection.getCallForwardingOption","getCallForwardingOption()")}} e {{domxref("MozMobileConnection.setCallForwardingOption","setCallForwardingOption()")}}.</p>
-<pre class="brush: js">var options = {
- action : MozMobileCFInfo.CALL_FORWARD_ACTION_ENABLE,
- reason : MozMobileCFInfo.CALL_FORWARD_REASON_UNCONDITIONAL,
- serviceClass: MozMobileConnectionInfo.ICC_SERVICE_CLASS_VOICE,
- number : prompt('To which phone number would you wish to forward the calls?'),
- timeSeconds : 5
-};
-
-var setOption = navigator.mozMobileConnection.setCallForwardingOption(options);
-
-setOption.onsuccess = function () {
- console.log('Options successfully set');
-}
-
-setOption.onerror = function () {
- console.log('Unable to set options: ' + this.error.name);
-}
-</pre>
-<h3 id="Comandos_STK">Comandos STK</h3>
-<p>Os comandos STK dependem em vários fatores (operadoras, modelos de chips, etc.) mas podem sempre ser acessados pela propriedade {{domxref("MozMobileConnection.icc")}} que retorna um objeto {{domxref("MozIccManager")}}.</p>
-<div class="warning">
- <p><strong>Atenção:</strong> É recomendado utilizando comando STK apenas se você já sabe exatamente o que você está fazendo, porque a utilização errada pode danificar o chip e torná-lo inutilizável.</p>
-</div>
-<h2 id="Especificações">Especificações</h2>
-<p>Não faz parte de nenhuma especificação.</p>
-<h2 id="Veja_também">Veja também</h2>
-<ul>
- <li>{{domxref("window.navigator.mozMobileConnection","navigator.mozMobileConnection")}}</li>
- <li>{{domxref("MozMobileConnection")}}</li>
- <li>{{domxref("MozMobileConnectionInfo")}}</li>
- <li>{{domxref("MozMobileICCInfo")}}</li>
- <li>{{domxref("MozMobileNetworkInfo")}}</li>
- <li>{{domxref("MozMobileCFInfo")}}</li>
- <li>{{domxref("MozMobileCellInfo")}}</li>
- <li>{{domxref("MozIccManager")}}</li>
- <li>{{domxref("MozStkCommandEvent")}}</li>
-</ul>
diff --git a/files/pt-br/webapi/network_stats/index.html b/files/pt-br/webapi/network_stats/index.html
deleted file mode 100644
index 9276841db3..0000000000
--- a/files/pt-br/webapi/network_stats/index.html
+++ /dev/null
@@ -1,86 +0,0 @@
----
-title: Network Stats
-slug: WebAPI/Network_Stats
-translation_of: Archive/B2G_OS/API/Network_Stats_API
----
-<p>{{ non-standard_header() }}</p>
-<p>{{ B2GOnlyHeader2('certified') }}</p>
-<h2 id="Sumário">Sumário</h2>
-<p>A API do Estado de Rede permite monitorar utilização de dados e expor esses dados para aplicações certificadas.</p>
-<p>Os dados podem ser acessados através de {{domxref("window.navigator.mozNetworkStats","navigator.mozNetworkStats")}} que é uma instância da interface {{domxref("MozNetworkStatsManager")}}.</p>
-<h2 id="Acessando_os_dados">Acessando os dados</h2>
-<p>Informações sobre o volume de dados recebidos e enviados é automaticamente guardado no sistema.  É possível acessá-los utilizando o método {{domxref("MozNetworkStatsManager.getNetworkStats()")}}. Este método espera um objeto de configuração como seu primeiro parâmetro, que deve conter as seguintes propriedades:</p>
-<ul>
- <li><code>start</code>: Um objeto data representando o começo dos dados mensurados.</li>
- <li><code>end</code>: Um objeto data representando o final dos dados mensurados.</li>
- <li><code>connectionType</code>: A origem dos dados. Pode ser  <code>wifi</code>, <code>mobile</code>, ou <code>null</code>. Se for <code>null</code>, os dados mensurados de ambas origens são fundidos. Para saber com antecedência qual tipo de origem está disponível, a propriedade {{domxref("MozNetworkStatsManager.connectionTypes")}} returna um <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Array" title="/en-US/docs/JavaScript/Reference/Global_Objects/Array"><code>Array</code></a> de strings representando cada origem suportada.</li>
-</ul>
-<p>Quando chamada, este método retorna um {{domxref("DOMRequest")}} para lidar com o sucesso ou falha das informações requisitadas. Em caso de sucesso o <code>result</code> requisitado é um objeto {{domxref("MozNetworkStats")}}.</p>
-<pre class="brush: js">var manageWifi = navigator.mozNetworkStats.connectionTypes.indexOf('wifi') &gt; -1;
-var manageMobile = navigator.mozNetworkStats.connectionTypes.indexOf('mobile') &gt; -1;
-
-var config = {
- start: new Date(),
- end : new Date(),
- connectionType: manageWifi ? 'wifi' : null
-};
-
-var request = navigator.mozNetworkStats.getNetworkStats(config);
-
-request.onsuccess = function () {
- console.log("Data received: " + request.result.data[0].rxBytes + " bytes");
- console.log("Data sent: " + request.result.data[0].txBytes + " bytes")
-}
-
-request.onerror = function () {
- console.log("Something goes wrong: ", request.error);
-}
-</pre>
-<h2 id="Amostragem_ao_longo_do_tempo">Amostragem ao longo do tempo</h2>
-<p>Para ter uma visão dos dados utilizados ao longo do tempo, as informações sobre a quantidade de dados é armazenada em blocos. Cada bloco é um valor representando a quantidade de dados trocados desde que o último bloco foi armazenado.</p>
-<p>Quando requisitar os estados, o resultado do objeto {{domxref("MozNetworkStats")}} contém quantos o maior número de dados possíveis para um intervalo definido entre as datas de <code>start</code> e <code>end</code>. O número total de blocos depende de dois parâmetros (note que os parâmetros são apenas para leitura):</p>
-<ul>
- <li>{{domxref("MozNetworkStatsManager.sampleRate")}}, que representa o tempo em segundos entre dois blocos.</li>
- <li>{{domxref("MozNetworkStatsManager.maxStorageSamples")}}, que representa o número máximo de blocos de cada tipo de conexão.</li>
-</ul>
-<p>Cada bloco é um objeto {{domxref("MozNetworkStatsData")}}, e <span id="result_box" lang="pt"><span class="hps">todos os</span> <span class="hps">blocos de dados</span> <span class="hps">para um determinado</span> <span class="hps">período de tempo</span> <span class="hps">estão disponíveis</span> <span class="hps">através da propriedade</span></span> {{domxref("MozNetworkStats.data")}}, que são um <a href="/en-US/docs/JavaScript/Reference/Global_Objects/Array" title="/en-US/docs/JavaScript/Reference/Global_Objects/Array"><code>Array</code></a> de objetos {{domxref("MozNetworkStatsData")}}.</p>
-<pre class="brush: js">var rate = navigator.mozNetworkStats.sampleRate;
-var max = navigator.mozNetworkStats.maxStorageSample;
-
-var config = {
- start: new Date() - (rate * max), // This allows to get all the available data chunks.
- end : new Date(),
- connectionType: 'mobile'
-};
-
-var request = navigator.mozNetworkStats.getNetworkStats(config);
-
-request.onsuccess = function () {
- var total = {
- receive: 0,
- send : 0
- };
-
- this.result.forEach(function (chunk) {
- total.receive += chunk.rxBytes;
- total.send += chunk.txBytes;
- });
-
- console.log("Since: " + config.start.toString());
- console.log("Data received: " + (total.receive * 1000).toFixed(2) + "Ko");
- console.log("Data sent: " + (total.send * 1000).toFixed(2) + "Ko")
-}
-
-request.onerror = function () {
- console.log("Something goes wrong: ", request.error);
-}</pre>
-<h2 id="Especificações">Especificações</h2>
-<p>Não faz parte de uma especificação</p>
-<h2 id="Veja_também">Veja também</h2>
-<ul>
- <li>{{domxref("window.navigator.mozNetworkStats","navigator.mozNetworkStats")}}</li>
- <li>{{domxref("MozNetworkStats")}}</li>
- <li>{{domxref("MozNetworkStatsData")}}</li>
- <li>{{domxref("MozNetworkStatsManager")}}</li>
- <li><a href="/en-US/docs/WebAPI/Network_Stats_2_0_proposal" title="/en-US/docs/WebAPI/Network_Stats_2_0_proposal">NetworkStats API 2.0 proposal</a></li>
-</ul>
diff --git a/files/pt-br/webapi/tcp_socket/index.html b/files/pt-br/webapi/tcp_socket/index.html
deleted file mode 100644
index 48b49f4132..0000000000
--- a/files/pt-br/webapi/tcp_socket/index.html
+++ /dev/null
@@ -1,75 +0,0 @@
----
-title: TCP Socket
-slug: WebAPI/TCP_Socket
-translation_of: Archive/B2G_OS/API/TPC_Socket_API
----
-<p>{{ non-standard_header() }}</p>
-<p>{{ B2GOnlyHeader2('privileged') }}</p>
-<h2 id="Sumário">Sumário</h2>
-<p>A API TCPSocket oferece</p>
-<p>The TCPSocket API offers a whole API to open and use a TCP connection. This allows app makers to implement any protocol available on top of TCP such as IMAP, IRC, POP, HTTP, etc., or even build their own to sustain any specific needs they could have.</p>
-<h2 id="Permissões">Permissões</h2>
-<p>Para utilizar essa API, como todas as API privilegiadas, é necessário que tenha permissão para utilizar dentro do <a href="/en-US/docs/Web/Apps/Manifest">app manifest</a>.</p>
-<pre class="brush: json">"permissions" : {
- "tcp-socket" : {
- "description" : "Create TCP sockets and communicate over them."
- }
-}</pre>
-<h2 id="Overview">Overview</h2>
-<p>A API está disponível através da propriedade {{domxref("window.navigator.mozTCPSocket","navigator.mozTCPSocket")}} que por si é um objeto {{domxref("TCPSocket")}}.</p>
-<h3 id="Abrindo_um_socket.">Abrindo um socket.</h3>
-<p>Opening a socket is done with the {{domxref("TCPSocket.open()")}} method. This method expects up to three parameters:</p>
-<ol>
- <li>A string representing the hostname of the server to connect to (it can also be its raw IP address).</li>
- <li>A number representing the TCP port to be used by the socket (some protocols have a standard port, for example 80 for HTTP, 447 for SSL, 25 for SMTP, etc. Port numbers beyond 1024 are not assigned to any specific protocol and can be used for any purpose.)</li>
- <li>A optional object containing up to two options: a boolean named <code>useSSL</code> is the socket needed to use SSL, <code>false</code> by default; and a string named <code>binaryType</code> allows to state the type of data retrieved by the application through the {{event("data")}} event, with the expected values <code>string</code> or <code>arraybuffer</code>. By default, it is <code>string</code>.</li>
-</ol>
-<pre class="brush: js">var socket = navigator.mozTCPSocket.open('localhost', 80);</pre>
-<div class="note">
- <p><strong>Nota:</strong> Apenas aplicações certificadas podem utilizar portas abaixo de 1024.</p>
-</div>
-<h3 id="Enviando_dado">Enviando dado</h3>
-<p>Sending data is done using the {{domxref("TCPSocket.send()")}} method. The data sent can be either a string or a <code><a href="/en-US/docs/JavaScript/Typed_arrays/Uint8Array" title="/en-US/docs/JavaScript/Typed_arrays/Uint8Array">Uint8Array</a></code> object; however, remember that a TCP socket always deals with binary data. For that reason, it's a lot safer to use <code><a href="/en-US/docs/JavaScript/Typed_arrays/Uint8Array" title="/en-US/docs/JavaScript/Typed_arrays/Uint8Array">Uint8Array</a></code> instead of a string when sending data.</p>
-<p>As per the TCP protocol, it's a good optimization to send a maximum of 64kb of data at the same time. As long as less than 64kb has been buffered, a call to the {{domxref("TCPSocket.send()","send")}} method returns <code>true</code>. Once the buffer is full, the method will return <code>false</code> which indicates the application should make a pause to flush the buffer. Each time the buffer is flushed, a {{event("drain")}} event is fired and the application can use it to resume data sending.</p>
-<p>It's possible to know exactly the current amount of data buffered with the {{domxref("TCPSocket.bufferedAmount")}} property.</p>
-<pre class="brush: js">function getData() {
- var data;
-
- // do stuff that will retrieve data
-
- return data;
-}
-
-function pushData() {
- var data;
-
- do {
- data = getData();
- } while (data != null &amp;&amp; socket.send(data));
-}
-
-// Each time the buffer is flushed
-// we try to send data again.
-socket.ondrain = pushData;
-
-// Start sending data.
-pushData();
-</pre>
-<h3 id="Pegando_dado">Pegando dado</h3>
-<p>Each time the socket gets some data from the host, it fires a {{event("data")}} event. This event will give access to the data from the socket. The type of the data depends on the option set when the socket was opened (see above).</p>
-<pre class="brush: js">socket.ondata = function (event) {
- if (typeof event.data === 'string') {
- console.log('Get a string: ' + event.data);
- } else {
- console.log('Get a Uint8Array');
- }
-}</pre>
-<p>As the {{event("data")}} event is fired as much as needed, it can sometimes be necessary to pause the flow of incoming data. To that end, calling the {{domxref("TCPSocket.suspend()")}} method will pause reading incoming data and stop firing the {{event("data")}}. It's possible to start reading data and firing events again by calling the {{domxref("TCPSocket.resume()")}} method.</p>
-<h3 id="Fechando_um_socket">Fechando um socket</h3>
-<p>Closing a socket is simply done using {{domxref("TCPSocket.close()")}}.</p>
-<h2 id="Padrão">Padrão</h2>
-<p>Not part of any specification yet; however, this API is discussed at W3C as part of the <a class="external" href="http://www.w3.org/2012/sysapps/" rel="external" title="http://www.w3.org/2012/sysapps/">System Applications Working Group</a> under the <a href="http://www.w3.org/2012/sysapps/raw-sockets/" title="http://www.w3.org/2012/sysapps/raw-sockets/">Raw Sockets</a> proposal.</p>
-<h2 id="Veja_também">Veja também</h2>
-<ul>
- <li>{{domxref("TCPSocket")}}</li>
-</ul>
diff --git a/files/pt-br/webapi/web_activities/index.html b/files/pt-br/webapi/web_activities/index.html
deleted file mode 100644
index 0eae803549..0000000000
--- a/files/pt-br/webapi/web_activities/index.html
+++ /dev/null
@@ -1,421 +0,0 @@
----
-title: Web Activities
-slug: WebAPI/Web_Activities
-translation_of: Archive/B2G_OS/API/Web_Activities
----
-<p>{{ non-standard_header() }}</p>
-<p>{{B2GOnlyHeader2('installed')}}</p>
-<h2 id="Sumário">Sumário</h2>
-<p>Atividades Web define um modo para as aplicações delegarem uma atividade para a outra (geralmente escolhida pelo usuário) aplicação.</p>
-<p>Atividades Web estão atualmente habilitadas no Firefox OS apenas, e toda a especificação está <a href="https://wiki.mozilla.org/WebAPI/WebActivities" title="https://wiki.mozilla.org/WebAPI/WebActivities">disponível no WikiMo</a>.</p>
-<h2 id="Atividades">Atividades</h2>
-<p>An activity is something a user wants to do: pick an image, send an e-mail, etc. App authors may want to define an app that can handle an activity or that can delegate to an activity.</p>
-<h2 id="Registering_an_App_as_an_activity_handler">Registering an App as an activity handler</h2>
-<p>App authors can build an app that will handle one or more activities. That means that the app will be callable by another app to perform some specific actions defined by the activity. For example, let's pretend we want to build a photo manager. It could be used by another application to pick a photo. As an activity handler our app will become part of the other application's workflow.</p>
-<h3 id="Registrar_uma_atividade">Registrar uma atividade</h3>
-<p>There is currently only one way to register an app as an activity handler: declaring it in the app manifest.</p>
-<div class="note">
- <p><strong>Note:</strong> Any application can register itself as an activity handler for any existing activity or create its own activity. In both cases it's done the same way within the app manifest. However, when creating a new activity, it is considered best practice to avoid activities' name collisions by prefixing the name of the new activity with a URL (e.g.,
- <i>
- example.org/myActivity</i>
- or
- <i>
- org.example.myActivity</i>
- ).</p>
-</div>
-<h4 id="App_manifest_(a.k.a._declaration_registration)">App manifest (a.k.a. declaration registration)</h4>
-<p>We have to use the <a href="/en-US/docs/Apps/Manifest" title="/en-US/docs/Apps/Manifest">app manifest</a> to express that our app is expected to handle an activity as in this example:</p>
-<pre class="brush: js">{
- // Other App Manifest related stuff
-
- // Activity registration
- "activities": {
-
- // The name of the activity to handle (here "pick")
- "pick": {
- "href": "./pick.html",
- "disposition": "inline",
- "filters": {
- "type": ["image/*","image/jpeg","image/png"]
- },
- "returnValue": true
- }
- }
-}
-</pre>
-<h4 id="Dynamic_registration">Dynamic registration</h4>
-<p>There are plans to let an app register itself dynamically by using the {{domxref("window.navigator","navigator")}} object. However, this API is not available yet. See {{bug("775181")}} to follow the work about that specific API.</p>
-<h4 id="Activity_handler_description">Activity handler description</h4>
-<dl>
- <dt>
- <code>href</code></dt>
- <dd>
- When another app or Web page initiates an activity that is supported by this app, if this app is chosen to perform the activity, this specifies the page that will be opened. It will be opened in the manner specified by the <code>disposition</code> property.
- <div class="note">
- <strong>Note:</strong> The URL of this page is restricted by the rules of the <a href="/en-US/docs/JavaScript/Same_origin_policy_for_JavaScript" title="/en-US/docs/JavaScript/Same_origin_policy_for_JavaScript">same origin policy</a>.</div>
- </dd>
-</dl>
-<dl>
- <dt>
- <code>disposition</code> {{optional_inline()}}</dt>
-</dl>
-<dl>
- <dd>
- Specifies how the page specified in <code>href</code> is presented when an activity is invoked. The value, if specified, must be one of the following (if omitted, defaults to <code>window</code>):
- <ul>
- <li><strong><code>window</code></strong> - The page handling the activity is opened in a new "window" (on a mobile device this view will replace the original app that requested the activity). The page must call {{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}} for each activity it supports and subsequently execute the activity for which it receives a message.</li>
- <li><strong><code>inline</code></strong> - The page that handles the activity will open in an overlay (on a mobile device this will be rendered in a popup over the original app that requested the activity). Subsequent behavior is exactly the same as if <code>disposition</code> were <code>window</code>.</li>
- </ul>
- </dd>
-</dl>
-<dl>
- <dt>
- <code>returnValue</code> {{optional_inline()}}</dt>
- <dd>
- States if the activity will return a value or not. If an application doesn't plan to return a value, the UA may send a
- <i>
- success</i>
- event as soon as an application has been picked. If a value is expected, the activity handler must call {{domxref("MozActivityRequestHandler.postResult()")}} if the activity is successful or {{domxref("MozActivityRequestHandler.postError()")}} if the activity fails (where {{domxref("MozActivityRequestHandler")}} is the type of the first argument provided to the function specified within {{domxref("window.navigator.mozSetMessageHandler()","mozSetMessageHandler")}} by the activity handler). The <em>success</em> or <em>error</em> event will be respectively fired after {{domxref("MozActivityRequestHandler.postResult()","postResult")}} or {{domxref("MozActivityRequestHandler.postError()","postError")}} has been called by the activity handler.</dd>
-</dl>
-<dl>
- <dt>
- <code>filters</code> {{optional_inline()}}</dt>
- <dd>
- A dictionary where each property of which specifies a filter. These filters will be applied while determining apps suitable for handling a given activity. Filter names are free-form text and should mirror {{domxref("MozActivityOptions.data","data")}} properties' names from {{domxref("MozActivityOptions")}}. Filters' values are either a basic value (string or number), an array of basic values, or a filter definition object. An activity will be considered as able to handle an activity only if the filters are all satisfied.</dd>
-</dl>
-<p>The way filters are handled depend on each filter value:</p>
-<ul>
- <li>If the filter value is a basic value, the corresponding {{domxref("MozActivityOptions.data")}} property is optional but if the property exist it must have the same value as the one provided by the filter.</li>
- <li>If the filter value is an array of basic values, the corresponding {{domxref("MozActivityOptions.data")}} property is optional but if the property exists its value must be equal to one of the values available in the array provided by the filter.</li>
- <li>If the filter value is a filter definition object, the filter will be satisfied if the corresponding {{domxref("MozActivityOptions.data")}} property follows the rules defined by the object. A filter definition object can have the following properties:
- <ul>
- <li><code>required</code>: A boolean that indicates if the corresponding {{domxref("MozActivityOptions.data")}} property must exist (<code>true</code>) or not (<code>false</code>).</li>
- <li><code>value</code>: A basic value or an array of basic value. The corresponding {{domxref("MozActivityOptions.data")}} property value must be equal to one of the values defined in the filter.</li>
- <li><code>min</code>: If the expected value is a number, the corresponding {{domxref("MozActivityOptions.data")}} property value must be greater than or equal to that value.</li>
- <li><code>max</code>: If the expected value is a number, the corresponding {{domxref("MozActivityOptions.data")}} property value must be lesser than or equal to that value.</li>
- <li><code>pattern</code>: A string pattern following the <a href="/en-US/docs/JavaScript/Guide/Regular_Expressions" title="/en-US/docs/JavaScript/Guide/Regular_Expressions">JavaScript regular expression</a> syntax. The corresponding {{domxref("MozActivityOptions.data")}} property value must match that pattern. <strong>This is supported in Firefox OS from v1.2.</strong></li>
- <li><code>patternFlags</code>: If the <code>pattern</code> property is used, this property can be used to provide some extra regular expression flag such as <code>i</code> or <code>g</code>. <strong>This is supported in Firefox OS from v1.2.</strong></li>
- <li><code>regexp</code>: A string containing a regexp litteral following the <a href="/en-US/docs/JavaScript/Guide/Regular_Expressions" title="/en-US/docs/JavaScript/Guide/Regular_Expressions">JavaScript regular expression</a> syntax. The corresponding {{domxref("MozActivityOptions.data")}} property value must match that pattern. In contrary to the pattern flag, this can match only part of the value, therefore you must use the metacharacters ^ and $ to respectively match the start and the end of the string. <strong>This is supported in Firefox OS v1.0 and v1.1 only.</strong> Therefore you're advised to use both <code>pattern</code> and <code>regexp</code>.</li>
- </ul>
- </li>
-</ul>
-<h2 id="Handle_an_activity">Handle an activity</h2>
-<p>Once our application is declared as an activity handler, we have to make it concrete by performing some actions when receiving an activity request from another app.</p>
-<p>To handle the activity, we have to register a function that will perform all the necessary actions. To do so, we need to set a message handler with {{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}}, specifically assigned to the <code>'activity'</code> message (and not the name of the activity). A {{domxref("MozActivityRequestHandler")}} object is passed as an argument of the activity handler function.</p>
-<pre class="brush: js">navigator.mozSetMessageHandler('activity', function(activityRequest) {
- // Do something to handle the activity
-});</pre>
-<p>As the activity handler function is performing an action, it will use the activity request to retrieve information about the activity and to send back an answer if necessary.</p>
-<p>The app that calls the activity has to provide some data (see below). This data can be reached through the request's {{domxref("MozActivityRequestHandler.source","source")}} properties which is a {{domxref("MozActivityOptions")}} object. This object provides the {{domxref("MozActivityOptions.name","name")}} of the activity call and the associated {{domxref("MozActivityOptions.data","data")}}.</p>
-<pre class="brush: js">navigator.mozSetMessageHandler('activity', function(activityRequest) {
- var option = activityRequest.source;
-
- if (option.name === "pick") {
- // Do something to handle the activity
- }
-});</pre>
-<p>Once we have performed all the actions to handle the activity, we can call the request's {{domxref("MozActivityRequestHandler.postResult()","postResult()")}} method to send the result back to the app that delegated the activity.</p>
-<p>If something goes wrong we can call the request's {{domxref("MozActivityRequestHandler.postError()","postError()")}} method to send back an error message about the activity.</p>
-<pre class="brush: js">navigator.mozSetMessageHandler('activity', function(activityRequest) {
- var option = activityRequest.source;
-
- if (option.name === "pick") {
- // Do something to handle the activity
- ...
-
- // Send back the result
- if (picture) {
- activityRequest.postResult(picture);
- } else {
- activityRequest.postError("Unable to provide a picture");
- }
- }
-});</pre>
-<div class="note">
- <p><strong>Note:</strong> UA is expected to send an error anyway at some point if neither {{domxref("MozActivityRequestHandler.postError()","postError")}} nor {{domxref("MozActivityRequestHandler.postResult()","postResult()")}} are called--for example, if the user leaves the application (closes the tab on desktop or goes back to the home screen on a mobile device).</p>
-</div>
-<h2 id="Starting_an_activity">Starting an activity</h2>
-<p>On the other side of <em>Web Activities</em>, there are apps that want to delegate an activity to our app. To perform such delegation, the apps have to call an activity by instantiating a {{domxref("MozActivity")}} object. Such objects are nothing less than {{domxref("DOMRequest")}} objects that allow to wait for any response from the activity handler. As soon as the object is constructed, the activity is started, and the UI is shown to the user as soon as possible.</p>
-<pre class="brush: js" id=".C2.A0">var activity = new MozActivity({
- // Ask for the "pick" activity
- name: "pick",
-
- // Provide the data required by the filters of the activity
- data: {
- type: "image/jpeg"
- }
-});
-
-activity.onsuccess = function() {
- var picture = this.result;
- console.log("A picture has been retrieved");
-};
-
-activity.onerror = function() {
- console.log(this.error);
-};
-</pre>
-<h3 id="Firefox_OS_activities">Firefox OS activities</h3>
-<p><a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia" title="/en-US/docs/Mozilla/Firefox_OS/Platform/Gaia">Gaia</a>, the native interface for Firefox OS, provides many built-in applications that define basic activities. Those activities are the following:</p>
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Name</th>
- <th scope="col">Application</th>
- <th scope="col">Expected Data (filters)</th>
- <th scope="col">Comments</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>browse</code></td>
- <td>Gallery</td>
- <td>
- <pre class="brush: js">
-type: "photos"</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td><code>configure</code></td>
- <td>Settings</td>
- <td>
- <pre class="brush: js">
-target: "device"</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td><code>costcontrol/balance</code></td>
- <td>Costcontrol</td>
- <td>None</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>costcontrol/data_usage</code></td>
- <td>Costcontrol</td>
- <td>None</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>costcontrol/telephony</code></td>
- <td>Costcontrol</td>
- <td>None</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>dial</code></td>
- <td>Communication</td>
- <td>
- <pre class="brush: js">
-type: "webtelephony/number",
-number: {
- regexp:/^[\\d\\s+#*().-]{0,50}$/
-}</pre>
- </td>
- <td>Used when an app wants to pass a phone call.</td>
- </tr>
- <tr>
- <td colspan="1" rowspan="3"><code>new</code></td>
- <td>Communication</td>
- <td>
- <pre class="brush: js">
-type: "webcontacts/contact"</pre>
- </td>
- <td>Used when an app wants to create a new contact entry.</td>
- </tr>
- <tr>
- <td>Email</td>
- <td>
- <pre class="brush: js">
-type: "mail"</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td>SMS</td>
- <td>
- <pre class="brush: js" id="LC48">
-type: "websms/sms",
-number: {
- regexp:/^[\\w\\s+#*().-]{0,50}$/
-}</pre>
- </td>
- <td>Used when an app wants to send an SMS.</td>
- </tr>
- <tr>
- <td colspan="1" rowspan="4"><code>open</code></td>
- <td>Communication</td>
- <td>
- <pre class="brush: js">
-type: "webcontacts/contact"</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td>Gallery</td>
- <td>
- <pre class="brush: js">
-type: [
- "image/jpeg",
- "image/png",
- "image/gif",
- "image/bmp"
-]</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td>Music</td>
- <td>
- <pre class="brush: js">
-type: [
- "audio/mpeg",
- "audio/ogg",
- "audio/mp4"
-]</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td>Video</td>
- <td>
- <pre class="brush: js">
-type: [
- "video/webm",
- "video/mp4",
- "video/3gpp",
- "video/youtube"
-]</pre>
- <p>Also expect a <code>blob</code> property which is a {{domxref("Blob")}} object.</p>
- </td>
- <td>Used when an app wants to display a video (the <code>view</code> activity allows to do the same).</td>
- </tr>
- <tr>
- <td colspan="1" rowspan="2"><code>pick</code></td>
- <td>Camera, Gallery, Wallpaper</td>
- <td>
- <pre class="brush: js">
-type: ["image/*", "image/jpeg"]</pre>
- </td>
- <td>Used when an app wants to get a picture.</td>
- </tr>
- <tr>
- <td>Communication</td>
- <td>
- <pre class="brush: js">
-type: [
- "webcontacts/contact",
- "webcontacts/email"
-]</pre>
- </td>
- <td>Used when an app wants to retrieve some contact information or an e-mail.</td>
- </tr>
- <tr>
- <td><code>record</code></td>
- <td>Camera</td>
- <td>
- <pre class="brush: js">
-type: ["photos", "videos"]</pre>
- </td>
- <td>Used when an app wants to record some video.</td>
- </tr>
- <tr>
- <td><code>save-bookmark</code></td>
- <td>Homescreen</td>
- <td>
- <pre class="brush: js" id="LC46">
-type: "url",
-url: {
- required:true,
- regexp:/^https?:/
-}</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td colspan="1" rowspan="2"><code>share</code></td>
- <td>Bluetooth</td>
- <td>
- <pre class="brush: js">
-number: 1
-</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td>Email, Wallpaper</td>
- <td>
- <pre class="brush: js">
-type: "image/*"</pre>
- </td>
- <td>Used when an app wants to share an image.</td>
- </tr>
- <tr>
- <td colspan="1" rowspan="4"><code>view</code></td>
- <td>Browser</td>
- <td>
- <pre class="brush: js">
-type: "url"
-url: {
- required: true,
- regexp: /^https?:.{1,16384}$/
-}</pre>
- </td>
- <td>Used when an app wants to open a URL.</td>
- </tr>
- <tr>
- <td>Email</td>
- <td>
- <pre class="brush: js" id="LC64">
-type: "url",
-url: {
- required:true,
- regexp:/^mailto:/
-}</pre>
- </td>
- <td> </td>
- </tr>
- <tr>
- <td>PDFs</td>
- <td>
- <pre class="brush: js">
-type: "application/pdf"</pre>
- </td>
- <td>Used when an app wants to display the content of a PDF document.</td>
- </tr>
- <tr>
- <td>Video</td>
- <td>
- <pre class="brush: js">
-type: [
- "video/webm",
- "video/mp4",
- "video/3gpp",
- "video/youtube"
-]</pre>
- <p>Also expect a <code>url</code> property which is a string.</p>
- </td>
- <td>Used when an app wants to display a video (the <code>open</code> activity allows to do the same).</td>
- </tr>
- <tr>
- <td><code>update</code></td>
- <td>Communication</td>
- <td>
- <pre class="brush: js">
-type: "webcontacts/contact"</pre>
- </td>
- <td>Used when an app wants to update a contact.</td>
- </tr>
- </tbody>
-</table>
-<h2 id="Specification">Specification</h2>
-<p><em>Web Activities</em> is not part of any specification. However, it has some overlap with the proposed <a href="https://dvcs.w3.org/hg/web-intents/raw-file/tip/spec/Overview-respec.html" title="http://www.w3.org/TR/web-intents/">Web Intents</a> specification. Mozilla actually proposed <em>Web Activities</em> as <a href="https://wiki.mozilla.org/WebAPI/WebActivities" title="https://wiki.mozilla.org/WebAPI/WebActivities">a counter proposal</a> to <em>Web Intents</em>. For more information about this, see discussion on the <a href="http://lists.w3.org/Archives/Public/public-web-intents/2012Jun/0061.html" title="http://lists.w3.org/Archives/Public/public-web-intents/2012Jun/0061.html">Web Intents Task Force ML</a>.</p>
-<h2 id="See_also">See also</h2>
-<ul>
- <li>{{domxref("MozActivity")}}</li>
- <li>{{domxref("MozActivityRequestHandler")}}</li>
- <li>{{domxref("MozActivityOptions")}}</li>
- <li>{{domxref("window.navigator.mozSetMessageHandler()","navigator.mozSetMessageHandler()")}}</li>
- <li><a href="https://hacks.mozilla.org/2013/01/introducing-web-activities/" title="https://hacks.mozilla.org/2013/01/introducing-web-activities/">Introducing Web Activities</a></li>
-</ul>
diff --git a/files/pt-br/webapi/websms/index.html b/files/pt-br/webapi/websms/index.html
deleted file mode 100644
index db11b891c0..0000000000
--- a/files/pt-br/webapi/websms/index.html
+++ /dev/null
@@ -1,136 +0,0 @@
----
-title: WebSMS
-slug: WebAPI/WebSMS
-tags:
- - MMS
- - SMS
- - WebSMS
-translation_of: Archive/B2G_OS/API/Mobile_Messaging_API
----
-<p>{{ non-standard_header() }}</p>
-
-<p>{{ B2GOnlyHeader2('certified') }}</p>
-
-<h2 id="Resumo">Resumo</h2>
-
-<p>WebSMS é uma API que possibilita a criação, envio e recebimento de SMS (Short Message Service) ou MMS (Multimedia Messaging Service).</p>
-
-<p>A API está disponível usando {{ domxref("window.navigator.mozSms") }} que retorna um objeto {{ domxref("MozSmsManager") }} ou {{ domxref("window.navigator.mozMobileMessage") }} que retorna {{ domxref("MozMobileMessageManager") }}. Veja abaixo uma lista completa com o métodos:</p>
-
-<h2 id="Interfaces_do_DOM">Interfaces do DOM</h2>
-
-<h3 id="SMS">SMS</h3>
-
-<ul>
- <li>{{ domxref("window.navigator.mozSms") }} {{deprecated_inline("25")}}</li>
- <li>{{ domxref("MozSmsManager") }} {{deprecated_inline("25")}}</li>
- <li>{{ domxref("MozSmsMessage") }}</li>
- <li>{{ domxref("MozSmsEvent") }}</li>
- <li>{{ domxref("MozSmsFilter") }}</li>
- <li>{{ domxref("MozSmsSegmentInfo") }}</li>
-</ul>
-
-<h3 id="MMS_e_SMS">MMS e SMS</h3>
-
-<ul>
- <li>{{ domxref("MozMobileMessageManager")}}</li>
- <li>{{ domxref("MozMmsMessage") }}</li>
- <li>{{ domxref("MozMmsEvent") }}</li>
- <li>{{ domxref("MozMobileMessageThread") }}</li>
-</ul>
-
-<h2 id="Código_de_exemplo_e_introdução">Código de exemplo e introdução</h2>
-
-<ul>
- <li><a href="/en-US/docs/WebAPI/WebSMS/Introduction_to_Mobile_Message_API" title="en/API/WebSMS/Introduction_to_WebSMS">Introdução à Mobile Message API</a></li>
-</ul>
-
-<h2 id="Especificações">Especificações</h2>
-
-<p>Essa especificação ainda não é padrão, mas já está em discussão no W3C como parte do <a href="http://www.w3.org/2012/sysapps/" title="http://www.w3.org/2012/sysapps/">System Application Working Group</a>.</p>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">Especificação</th>
- <th scope="col">Status</th>
- <th scope="col">Comentário</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('Messaging')}}</td>
- <td>{{Spec2('Messaging')}}</td>
- <td>projeto de edição (WIP).</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Compatibilidade_dos_browsers">Compatibilidade dos browsers</h2>
-
-<p>Pro razões óbvias, o suprote é esperado primeiramente em browser para dispositivos móveis.</p>
-
-<p>{{ CompatibilityTable() }}</p>
-
-<div id="compat-desktop">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Chrome</th>
- <th>Firefox (Gecko)</th>
- <th>Internet Explorer</th>
- <th>Opera</th>
- <th>Safari</th>
- </tr>
- <tr>
- <td>Suporte Básico</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<div id="compat-mobile">
-<table class="compat-table">
- <tbody>
- <tr>
- <th>Feature</th>
- <th>Android</th>
- <th>Firefox Mobile (Gecko)</th>
- <th>IE Mobile</th>
- <th>Opera Mobile</th>
- <th>Safari Mobile</th>
- </tr>
- <tr>
- <td>Suporte Básico</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatGeckoMobile("12.0") }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- <td>{{ CompatNo() }}</td>
- </tr>
- </tbody>
-</table>
-</div>
-
-<h2 id="sect1"> </h2>
-
-<h2 id="Preferências_e_disponibilidade">Preferências e disponibilidade</h2>
-
-<ul>
- <li>WebSMS está desativada por padrão e pode ser ativada setando o parâmetro <code>dom.sms.enabled</code> como true.</li>
- <li>Uma lista com os hostnames que podem utilizar a API pode ser criada separando cada hostname por vírgula, utilizando <code>dom.sms.whitelist</code>. Essa string vem vazia por padrão.</li>
- <li>WebSMS está disponível apenas para apps certificados do Firefox OS (B2G).</li>
- <li>MMS está disponível a partir do Firefox OS 1.1</li>
-</ul>
-
-<h2 class="note" id="Veja_também">Veja também</h2>
-
-<ul>
- <li><a class="link-https" href="https://wiki.mozilla.org/WebAPI/WebSMS" title="https://wiki.mozilla.org/WebAPI/WebSMS">WebSMS API</a></li>
-</ul>