[android-developers] Problem with Adding Action Buttons in the Action Bar Using Pager and Fragments

2015-12-15 Thread Mark Phillips
My app has three tabs and I am using a pager to switch between the tabs.
Each tab has its own fragment. I added the Settings and Help action buttons
to the action bar in the main Activity using the OptionsMenu methods. I now
want to add a new action button to the action bar, but just for the first
tab and first fragment, and I don't want it to appear on the other
fragments when they are displayed in their tabs.

I have this layout for the main menu that is created in the main activity -

http://schemas.android.com/apk/res/android;
xmlns:app="http://schemas.android.com/apk/res-auto;
xmlns:tools="http://schemas.android.com/tools;
tools:context=".MainActivity">






This menu displays correctly and works as expected.

I have another menu, menu_prelaunch_fragment for the first fragment -

http://schemas.android.com/apk/res/android;
xmlns:app="http://schemas.android.com/apk/res-auto;>




and I add it to the action bar using the following code in the first
fragment -

@Override
public void onCreate(Bundle savedInstance) {
Log.d(TAG, "onCreate");
super.onCreate(savedInstance);
setHasOptionsMenu(true);
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflator) {
Log.d(TAG, "onCreateOptionsMenu");
inflator.inflate(R.menu.menu_prelaunch_fragment, menu);
super.onCreateOptionsMenu(menu, inflator);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
Log.d(TAG, "onOptionsItemSelected");
if (item.getItemId() == R.id.clear_form)
clearFragmentData();
return super.onOptionsItemSelected(item);
}

The problem is that this added button does not go away when I go to the
other fragments on the other pages/tabs. The other fragments do not have
any options menu code in them.

I then added this code to the other fragments to remove the one button.

@Override
public void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}

@Override
public void onPrepareOptionsMenu (Menu menu) {
menu.findItem(R.id.clear_form).setVisible(false);
super.onPrepareOptionsMenu(menu);
}

But now the clear button does not appear in the action bar regardless of
what tabs are selected.

How do I add an action button to the action bar just for one tab (ie
fragment) in my three tab (ie three fragment) app? It should only appear
when that tab (fragment) is selected (displayed).

Thanks!

Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CAEqej2MoYS7fzcXcT04jS8HWT-a78%2Brienr913OadraXwxsX-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: How do i rate and classificate my app on Google Play Store?

2015-12-15 Thread Justanick
Thank you, i guess the same, just i can't understand first which category 
it should be inserted to and second how to really get a +18 classification, 
because as i put all YES answers the maximum age rating i get is +12, very 
strange :(

Il giorno martedì 15 dicembre 2015 15:06:48 UTC+1, richarth ha scritto:
>
> They probably think your app needs a more mature rating as potentially the 
> video could contain anything.
>
> On 15 December 2015 at 13:32, Justanick  > wrote:
>
>> *Forgot to say, the app is a chat roulette like videochat, you can meet 
>> strangers from all over the world.*
>>
>> Maybe somebody already got a videochat approved and could help, i hope, 
>> thank you.
>>
>> Il giorno martedì 15 dicembre 2015 14:27:21 UTC+1, Justanick ha scritto:
>>>
>>> Hello everybody, me and a friend we submitted an app to the Google Play 
>>> Store, actually only in Alpha mode.
>>>
>>> We got it rejected twice and the reason is:
>>>
>>> *Policy Issue: Your app was rejected for violating the Developer Program 
>>> Policies . 
>>> Your app’s rating category and content rating are incorrect.*
>>>
>>>- *The content of your app must be rated in accordance with 
>>>our Content Rating Guidelines 
>>>.*
>>>- *These guidelines apply to all content in your app, including user 
>>>generated content, in-app products, and advertisements.*
>>>
>>> *Here’s how you can submit your app for another review:*
>>>
>>>1. *Sign in to your Developer Console 
>>> and select the correct rating 
>>>category for your app.*
>>>2. *Take the content rating questionnaire again, paying special 
>>>attention to questions about social media.*
>>>3. *Review your app to make sure it’s in compliance with the 
>>>policies listed in the Developer Program Policies 
>>>.*
>>>4. *Submit your app.*
>>>
>>>
>>> Actually i really don't know what's wrong and what to change to make 
>>> this approved.
>>>
>>> Do you know how to classificate and which category should we use to 
>>> publish it?
>>>
>>> Maybe we have to put all the answers to YES on the quesitonaire?
>>> Specially when they ask us if app contains violence or offensive humor 
>>> etc..?
>>>
>>> Any help is really appreciated, thank you a lot.
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Android Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to android-developers+unsubscr...@googlegroups.com .
>> To post to this group, send email to android-d...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/android-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/android-developers/cc3ed6af-4320-4a69-a10e-f769450c15a1%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c085baf8-f542-49f9-9cd9-c15dd3fcbd16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Notifying app user when a new article has been posted on the app.

2015-12-15 Thread Sara Cook
Hello,

I currently have an app that receives news articles with a volley and is 
constantly updated. I want the app to send a notification to the user when 
a new article is posted. So far I have this code in my response listener 
but I'm not sure if it's in the right place or if it is detecting a new 
news article.

Any help would be useful as i'm new to android development! 

public class MainActivity extends AppCompatActivity {

private List newsListData = new ArrayList();

private GridView newsListView;

private NewsListAdapter adapter;

LinearLayout layout;

List stringValues;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

layout = (LinearLayout) findViewById(R.id.progressbar_view);

GridView newsListView = (GridView) findViewById(R.id.newsFeedList);

adapter = new NewsListAdapter(this, R.layout.adapter_news_list, 
newsListData, this);

newsListView.setAdapter(adapter);

newsListView.setOnItemClickListener(itemClicked);

nextStart = 0;
updateListData(nextStart, 20);
}

class Task extends AsyncTask {
@Override
protected void onPreExecute() {
layout.setVisibility(View.VISIBLE);
newsListView.setVisibility(View.GONE);
super.onPreExecute();
}

@Override
protected void onPostExecute(Boolean result) {
layout.setVisibility(View.GONE);
newsListView.setVisibility(View.VISIBLE);
adapter.notifyDataSetChanged();
super.onPostExecute(result);
}

@Override
protected Boolean doInBackground(String... params) {
stringValues.add("String 1");
stringValues.add("String 2");
stringValues.add("String 3");
stringValues.add("String 4");
stringValues.add("String 5");

try {
Thread.sleep(3000);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

public int nextStart = 0;

public void updateListData(int StartPoint, int count){
String url = 
"http://www.efstratiou.info/projects/newsfeed/getList.php?start=; + StartPoint 
+ "=" + count;

EDANewsApp app = EDANewsApp.getInstance();

JsonArrayRequest jsonRequest = new JsonArrayRequest(url, listener, 
errorListener);
app.requestQueue.add(jsonRequest);

nextStart +=count;
}

@Override
public boolean onCreateOptionsMenu (Menu menu){
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
return true;
}

public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.action_about:
Intent intent = new Intent(this, AboutActivity.class);
startActivity(intent);
return true;
case R.id.action_search:
return true;
case R.id.action_settings:
return true;
default:
return super.onOptionsItemSelected(item);
}
}

AdapterView.OnItemClickListener itemClicked = new 
AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView parent, View view, int position, 
long id) {

Intent intent = new Intent(MainActivity.this, 
NewsItemActivity.class);

intent.putExtra("newsItemId", newsListData.get(position).recordId);

startActivity(intent);
}
};

//Listeners
Response.Listener listener = new Response.Listener() {
@Override
public void onResponse(JSONArray response) {
//we successfully received the JSONArray
//Here we will extract the data and use it in our app

//Clear the dataset before loading new data
  //  newsListData.clear();
//Go through all the JSON objects
for (int i = 0; i < response.length(); i++) {

try {
//Get one JSON object
JSONObject jsonObj = response.getJSONObject(i);

//Put JSON data in a Java object
NewsRecord record = new NewsRecord();
record.recordId = jsonObj.getInt("record_id");
record.title = jsonObj.getString("title");
record.date = jsonObj.getString("date");
record.shortInfo = jsonObj.getString("short_info");
record.imageUrl = jsonObj.getString("image_url");

newsListData.add(record);

} catch (JSONException e) {
e.printStackTrace();
}

}
adapter.notifyDataSetChanged();

[android-developers] Adding auto complete text view in a sliding tabs layout

2015-12-15 Thread Salwa Ahmed
Hi guys i'm new to android and i'm developing an app where i could type in 
something and the suggestion list would appear with words but i'm facing 
difficulty it doesn't work with the sliding tabs i have kept this in tab 1. 
what is the cause of it not working? help pls

thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/d996e315-23ac-4550-84bc-9ddfdd518237%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Insert event with CUSTOM_APP_URI and Launch an activity from calendar application

2015-12-15 Thread raveesh L

favorite 


I'm trying to open my android application from calendar event using 
CUSTOM_APP_URI.

   1. So i insert an event to Calendar through my application.
   2. Opening Calendar app, and navigating to the event details.
   3. Clicking on the event URI, my app should open from calendar events 
   details page.

Here is the code i used for inserting the events into calendar

@Overrideprotected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Calendar beginCal = Calendar.getInstance();
beginCal.set(2015, 11, 10, 4, 30);
long startTime = beginCal.getTimeInMillis();

Calendar endCal = Calendar.getInstance();
endCal.set(2015, 11, 10, 4, 30);
long endTime = endCal.getTimeInMillis();

ContentValues values = new ContentValues();
values.put(CalendarContract.Events.CALENDAR_ID, 1);
values.put(CalendarContract.Events.TITLE, "Check Demo Calendar4");
values.put(CalendarContract.Events.DTSTART, startTime);
values.put(CalendarContract.Events.DTEND, endTime);
values.put(CalendarContract.Events.EVENT_TIMEZONE, 
TimeZone.getDefault().getID());

values.put(CalendarContract.Events.CUSTOM_APP_PACKAGE, getPackageName());
values.put(CalendarContract.Events.CUSTOM_APP_URI, "calendar://1");

getContentResolver().insert(CalendarContract.Events.CONTENT_URI, values);
}

Calendar displaying the ever perfectly but Problem is even after inserting 
the event, calendar doesn't show the URI in my calendar event's detail 
page. What is wrong inserting the vent with CUSTOM_APP_URI? I would like to 
launch an activity, when user clicks on Calendar event? Any help?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/a37dbce7-9b93-4fd7-a8cc-f3a15b6a0e29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android Apps Without Main Activity

2015-12-15 Thread Dennis Keith Gaso
I saw some apps in my Android phone that have no main activity like 
packageInstaller, flash light, and cardiograph. My Question is, what is the 
purpose of apps without main activity? How can i use them?

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f0a07639-4229-443f-b501-3b09adc0a474%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: determining when users uninstall my app

2015-12-15 Thread VISHAL TIKKU
You can track it through yourself if you don't have standalone application 
ie if your app requires any server communication.Through server 
communication you can maintain the number of users that are using your 
application and sending time spent(use CountDownTimer) on each page to the 
server and maintaining in database with respect to the user can help you 
trace how much a user is exploring your application in the end the above 
solution will work if you are maintaining user records on your server.  



On Monday, December 14, 2015 at 2:47:20 PM UTC+5:30, techma...@yahoo.com 
wrote:
>
>   I have a 50% uninstall rate on my mobile app. I'm looking for some 
> insights. I'd like to know more details on how quickly users uninstall, how 
> deep users explored my 
>   app before they unstalled and the path they navigated through my app. 
> Through these metrics, I may be able to determine some patterns that could 
> help me improve 
>   my app. Is there a way through Google Analytics or the Development 
> Console to determine these metrics?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f9e188b8-4ea1-47fb-b356-e758c11689cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: java code help

2015-12-15 Thread VISHAL TIKKU
Can you please elaborate.

On Monday, December 14, 2015 at 11:50:46 AM UTC+5:30, John Mmm wrote:
>
> how to make login form that connects to my website?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e50c9ef6-d0d2-40d2-87e8-794a01d0c1b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Rookie At Coding.

2015-12-15 Thread Fabian Azagra
This is my first time coding and i am using 
http://developer.android.com/training/basics/firstapp/creating-project.html 
as my training. But theres 3 pages of code with small errors on them and of 
course i have no idea how to tackle them. Any ideas would be awesome

1st page

 




-http://schemas.android.com/apk/res/android;>


-
















2nd page

android:theme="@style/AppTheme">








-http://schemas.android.com/apk/res/android;>








-


-


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c4ece6a3-c7d5-4a0e-a074-6d194851576c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How do i rate and classificate my app on Google Play Store?

2015-12-15 Thread Justanick
*Forgot to say, the app is a chat roulette like videochat, you can meet 
strangers from all over the world.*

Maybe somebody already got a videochat approved and could help, i hope, 
thank you.

Il giorno martedì 15 dicembre 2015 14:27:21 UTC+1, Justanick ha scritto:
>
> Hello everybody, me and a friend we submitted an app to the Google Play 
> Store, actually only in Alpha mode.
>
> We got it rejected twice and the reason is:
>
> *Policy Issue: Your app was rejected for violating the Developer Program 
> Policies . 
> Your app’s rating category and content rating are incorrect.*
>
>- *The content of your app must be rated in accordance with 
>our Content Rating Guidelines 
>.*
>- *These guidelines apply to all content in your app, including user 
>generated content, in-app products, and advertisements.*
>
> *Here’s how you can submit your app for another review:*
>
>1. *Sign in to your Developer Console 
> and select the correct rating 
>category for your app.*
>2. *Take the content rating questionnaire again, paying special 
>attention to questions about social media.*
>3. *Review your app to make sure it’s in compliance with the policies 
>listed in the Developer Program Policies 
>.*
>4. *Submit your app.*
>
>
> Actually i really don't know what's wrong and what to change to make this 
> approved.
>
> Do you know how to classificate and which category should we use to 
> publish it?
>
> Maybe we have to put all the answers to YES on the quesitonaire?
> Specially when they ask us if app contains violence or offensive humor 
> etc..?
>
> Any help is really appreciated, thank you a lot.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/cc3ed6af-4320-4a69-a10e-f769450c15a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android Pay for InAppPurchase

2015-12-15 Thread Archana
Hi

I am implementing InAppPurchase in myapplication. I have multiple 
subscription which is configured in Google store using 
("http://developer.android.com/google/play/billing/billing_subscriptions.html;).
 
So 
Inorder to purchase Subscription pack I need to enter my real credit card 
details. 

My app is uploaded to Sandbox environment at Google store and I used opt-in 
url to do test for  InAppBilling. Since 
It is uploaded to beta environment amount can be refunded. 
Now my question is 
1. Can we use Android 
Pay("https://developers.google.com/android-pay/test-flows?hl=en;) to do 
 InAppBilling/InAppPurchase? 
As per my understanding It can done via GooglePayment method only.
So Please correct me If I am wrong.



-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/b124c4f0-7d4d-4a2f-a6a4-fbb31a97874c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] How do i rate and classificate my app on Google Play Store?

2015-12-15 Thread Justanick
Hello everybody, me and a friend we submitted an app to the Google Play 
Store, actually only in Alpha mode.

We got it rejected twice and the reason is:

*Policy Issue: Your app was rejected for violating the Developer Program 
Policies . 
Your app’s rating category and content rating are incorrect.*

   - *The content of your app must be rated in accordance with our Content 
   Rating Guidelines 
   .*
   - *These guidelines apply to all content in your app, including user 
   generated content, in-app products, and advertisements.*

*Here’s how you can submit your app for another review:*

   1. *Sign in to your Developer Console 
    and select the correct rating 
   category for your app.*
   2. *Take the content rating questionnaire again, paying special 
   attention to questions about social media.*
   3. *Review your app to make sure it’s in compliance with the policies 
   listed in the Developer Program Policies 
   .*
   4. *Submit your app.*


Actually i really don't know what's wrong and what to change to make this 
approved.

Do you know how to classificate and which category should we use to publish 
it?

Maybe we have to put all the answers to YES on the quesitonaire?
Specially when they ask us if app contains violence or offensive humor 
etc..?

Any help is really appreciated, thank you a lot.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/115742a3-c54b-4c97-bd1d-cacf3b56ec0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: How do i rate and classificate my app on Google Play Store?

2015-12-15 Thread Richard Thompson
They probably think your app needs a more mature rating as potentially the
video could contain anything.

On 15 December 2015 at 13:32, Justanick  wrote:

> *Forgot to say, the app is a chat roulette like videochat, you can meet
> strangers from all over the world.*
>
> Maybe somebody already got a videochat approved and could help, i hope,
> thank you.
>
> Il giorno martedì 15 dicembre 2015 14:27:21 UTC+1, Justanick ha scritto:
>>
>> Hello everybody, me and a friend we submitted an app to the Google Play
>> Store, actually only in Alpha mode.
>>
>> We got it rejected twice and the reason is:
>>
>> *Policy Issue: Your app was rejected for violating the Developer Program
>> Policies .
>> Your app’s rating category and content rating are incorrect.*
>>
>>- *The content of your app must be rated in accordance with
>>our Content Rating Guidelines
>>.*
>>- *These guidelines apply to all content in your app, including user
>>generated content, in-app products, and advertisements.*
>>
>> *Here’s how you can submit your app for another review:*
>>
>>1. *Sign in to your Developer Console
>> and select the correct rating
>>category for your app.*
>>2. *Take the content rating questionnaire again, paying special
>>attention to questions about social media.*
>>3. *Review your app to make sure it’s in compliance with the policies
>>listed in the Developer Program Policies
>>.*
>>4. *Submit your app.*
>>
>>
>> Actually i really don't know what's wrong and what to change to make this
>> approved.
>>
>> Do you know how to classificate and which category should we use to
>> publish it?
>>
>> Maybe we have to put all the answers to YES on the quesitonaire?
>> Specially when they ask us if app contains violence or offensive humor
>> etc..?
>>
>> Any help is really appreciated, thank you a lot.
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/cc3ed6af-4320-4a69-a10e-f769450c15a1%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CAPhephW%3D_C1tgpHNjg7EF9UXKDUm1T5ZP14gsbkZoskFgpbnyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Who translates google play apps?

2015-12-15 Thread Vladimir Markiev
Well there is quite a big quantity of general words like "settings" which 
is pretty clear though there are abbreviations that present a challenge. 
But if the app's purpose is clear translation can be done quite easily.

On Monday, December 14, 2015 at 4:14:23 AM UTC+3, Quentin Christensen wrote:
>
> The way I've done my text, which I believe is the correct way but I 
> could be wrong, is that I've created an XML file - essentially it's like 
> a html file and I've got everything in there as in the below text, so 
> essentially the translation just needs to be the words in between the 
> tags, so for the option " Use sound 
> effects" it would be whatever the translation of "Use sound 
> effects" is, not the rest of that string.  One thing I'm not sure of is 
> that some of the strings are just one or two words so I'm not sure how 
> much context would be needed for some of them, but I guess if getting it 
> translated the person doing it could then come back and ask for 
> clarification on specific items. 
>
> Here's a sample from my strings.xml file: 
>
>  
>  
>
>  RapiTap! 
>  "22poi...@gmail.com " 
>  More from Developer 
>   href="https://play.google.com/store/apps/developer?id=22+Point;>More 
> from 22 Point 
>  Settings 
>  Show options next time 
>  Show detailed game information 
>  Use sound effects 
>  Use Text to Speech 
>  Verbose TTS Announcements 
>
>  
>  Easy 
>  Normal 
>  Hard 
>   
>
>  
>
> -- 
> 22 Point 
>
> Web: http://www.22point.com.au 
> Check out our "Making Windows 10 Easy" eBooks and award winning app, 
> RapiTap! 
>
> On 14/12/2015 12:41 AM, Vladimir Markiev wrote: 
> > I won't say thet Russian is more popular than English (is there any 
> > more popular language than English at all, except for perhaps 
> > Chinese?), especially when piracy is more wide-spread here, but I 
> > probably could translate although never had experience translating 
> > xml's. We really can build a mutually benefitial relationship here. 
> > 
> > On Sunday, December 13, 2015 at 2:34:06 AM UTC+3, Quentin Christensen 
> > wrote: 
> > 
> > The trick is probably the getting paid part.  I would love to have 
> my 
> > app translated into as many languages as possible and if you are 
> > interested in translating my app I can send you the strings.xml file 
> > right now!  But having sold less than 100 copies at $2.99 AUD (minus 
> > Google's cut), of an app which took several months development 
> > time, I'd 
> > need to translate it into a language a lot more popular than it's 
> > current English in order to recoup the costs of development, let 
> > alone 
> > to pay someone else. 
> > 
> > Out of curiousity, how much would translation cost? 
> > 
> > Kind regards 
> > 
> > Quentin. 
> > 
> > -- 
> > 22 Point 
> > 
> > Web: http://www.22point.com.au 
> > Check out our "Making Windows 10 Easy" eBooks and award winning 
> > app, RapiTap! 
> > 
> > On 12/12/2015 6:16 AM, Vladimir Markiev wrote: 
> > > So Google Play has a huge amount of different apps and games and 
> > often 
> > > I see people waiting for localization of certain app or game 
> > because 
> > > they don't speak English. This makes me wondering - who doe the 
> > > localization? Search gives only tips for those who want to 
> > translate 
> > > their app, but not for those who would like to assist translating 
> > > them. I work as a freelance translator and want to help those 
> > people, 
> > > who don't speak English by translating apps and games and maybe 
> > even 
> > > get paid for that. So does anyone know how to? 
> > > -- 
> > > You received this message because you are subscribed to the Google 
> > > Groups "Android Developers" group. 
> > > To unsubscribe from this group and stop receiving emails from 
> > it, send 
> > > an email to android-developers+unsubscr...@googlegroups.com 
>  
> >  
> > >   
> > >. 
> > > To post to this group, send email to 
> > > android-d...@googlegroups.com  
> > > . 
> > > Visit this group at 
> > http://groups.google.com/group/android-developers 
> > . 
> > > To view this discussion on the web visit 
> > > 
> > 
> https://groups.google.com/d/msgid/android-developers/c09c0a62-7698-481c-a6b0-937a60e33f64%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/android-developers/c09c0a62-7698-481c-a6b0-937a60e33f64%40googlegroups.com>
>  
>
> > 
> > > 
> > <
> https://groups.google.com/d/msgid/android-developers/c09c0a62-7698-481c-a6b0-937a60e33f64%40googlegroups.com?utm_medium=email_source=footer
>  
> > <
> 

[android-developers] How to avoid conflict with Google Now and other applications when I want to keep using the microphone in a background service.

2015-12-15 Thread Sailorfina
Hello, I want to develop an app that it can listen to my voice at any time 
at any screen. For example, I can say "Hi Buddy", then it can be activated 
and listen to my words. it is just like "Ok Google".

I'm using a background service to listen on the microphone, onece a 
keyworkd "Hi Buddy" is detectd, then it will be launched.

The current problem is that, there is a race condition of the microphone 
with Google Now (and other apps like Recorder app). To avoid affecting 
other apps, I want to release the microphone when Google Now's micophone 
button on launcher panel is clicked, or it is on the voice input page of 
Google Now. But I don't know when other apps are attempt to use the 
microphone, and can't detect wheather Google Now is showing the voice input 
page or not. So I don't know when to release the microphone. So when I app 
is running,  other apps are not able to use the microphone.

I create the AudioRecord with MediaRecorder.AudioSource.VOICE_RECOGNITION. 
There is another source MediaRecorder.AudioSource.HOTWORD, but it is a 
hidden audio source and require the permission 
android.permission.CAPTURE_AUDIO_HOTWORD, I can't get the permission as a 
non-system app.

My questions are:
1. How to detect if other apps trying to use the microphone or not. (or how 
the get the android.permission.CAPTURE_AUDIO_HOTWORD permission)
2. How to know if Google Now is showing its voice input page or not?
3. Any other workaround?

Anyone can help?

Sincerely
Tony

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/c25598c6-ac73-4ba7-9973-ec91821c58a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Disable Proximity Sensor programatically

2015-12-15 Thread azram0786
I am making a screen lock app. in this app when user listen call then 
screen turn off and screen lock activate due to proximity sensor.
I have done many tries with different angles but failed.
Now i want to disable proximity sensor with the help of code in my app.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/4ca4a79b-4b4b-4303-bbd6-af3521574e52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android USB host : interrupt do not respond immedietly

2015-12-15 Thread 최종택
I have a usb device which have a button. 
And I want to an android app to catch a signal of the button.
I found inferface and endpoint number of the button. 
It had seemed to perform ordinarily at galaxy S3 and galaxy note.
But later, I found that it has delay at other phones.

I was able to receive instant responses about 10% of the time; usually 
there was a 2-second delay, with some cases where the whole response was 
lost.

Although I couldn't figure out the exact reason, I realized that the phones 
that had response delays were those with kernel version 3.4 or later.

Here is the code that I used initially.

if(mConnection != null){
mConnection.claimInterface(mInterfaces.get(0), true);
final UsbEndpoint endpoint = mInterfaces.get(0).getEndpoint(0);
Thread getSignalThread = new Thread(new Runnable() {
@Override
public synchronized void run() {
byte[] buffer = new byte[8];
final ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
while(mConnection!=null){
int len = mConnection.bulkTransfer(endpoint, buffer, buffer.length, 0); 
if( len>=0  ){
// do my own code 
} 
} 
}
});
getSignalThread.setPriority(Thread.MAX_PRIORITY);
getSignalThread.start();
}

***edit timeout** *

when the timeout was set to 50ms, I wasn't able to receive responses most 
of the time. When the timeout was 500ms, I was able to initially get some 
delayed-responses; however, I lost all responses after several tries with 
this setting.


***Using UsbRequest***

In addition to using the bulktransfer method, I also tried using UsbRequest 
and below is the code that I used.

@Override
public synchronized void run() {
byte[] buffer = new byte[8];
final ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
UsbRequest inRequest = new UsbRequest();
inRequest.initialize(mConnection, endpoint);
while(mConnection!=null){
inRequest.queue( byteBuffer , buffer.length);
if( mConnection.requestWait() == inRequest  ){
// do my own code
}
} 
}

However, the same kind of delay happened even after using UsbRequest.

***Using libusb***

I also tried using 
[libusb_interrupt_transfer](http://libusb.sourceforge.net/api-1.0/group__syncio.html#gac412bda21b7ecf57e4c76877d78e6486)
 
from an open source library called libusb.
However this also produced the same type of delay that I had when using 
UsbDeviceConnection. 

unsigned char data_bt[8] = { 0, };
uint32_t out[2];
int transfered = 0;
while (devh_usb != NULL) {

libusb_interrupt_transfer(devh_usb, 0x83, data_bt, 8, , 0);
memcpy(out, data_bt, 8);
if (out[0] == PUSH) {
LOGI("button pushed!!!");
memset(data_bt, 0, 8);
//(env)->CallVoidMethod( thiz, mid);
}
}

After looking into the part where libusb_interrupt_transfer is processed 
libusb, I was able to figure out the general steps of interrupt_transfer:
1. make a transfer object of type interrupt
2. make a urb object that points to the transfer object
3. submit the urb object to the device's fd
4. detect any changes in the fd object via urb object
5. read urb through ioctl


steps 3, 4, 5 are the steps regarding file i/o.
I was able to find out that at step 4 the program waits for the button 
press before moving onto the next step.


Therefore I tried changing poll to epoll in order to check if the poll 
function was causing the delay; unfortunately nothing changed.

I also tried setting the timeout of the poll function to 500ms and making 
it always get values of the fd through ioctl but only found out that the 
value changed 2~3 seconds after pressing the button.

So in conclusion I feel that there is a delay in the process of updating 
the value of the fd after pressing the button. If there is anyone who could 
help me with this issue, please let me know. Thank you.


Thanks for reading

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/aafaf47e-b8c6-4d40-b94d-f73ce5ae22c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Disable proximity sensor with the help of code

2015-12-15 Thread azram0786
I am making a screen lock app. in this app when user listen call then 
screen turn off and screen lock activate due to proximity sensor.
I have done many tries with different angles but failed.
Now i want to disable proximity sensor with the help of code in my app.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/cb5fc110-267a-4100-b736-2cd14e8d4307%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.