永亮 赵 | 5 Aug 08:17 2015
Picon

lineSpacingExtra does not work on 5.0 for EditText

lineSpacingExtra does not work on 5.0 for EditText, can anybody help me.

赵永亮 (Jason Zhao)
电话:+86 13816303587
邮箱:yongliang <at> mochui.net
地址:上海市浦东新区张衡路666弄(盛大全球研发中心)1号8楼南

--

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pedr0 | 4 Aug 16:24 2015
Picon

ADB server on a different machine

Hi all,

Would it be possible to ask the adb client to connect to a different server than the one running on localhost ? Googling the problem I have bumped into the variable ANDROID_ADB_SERVER_PORT, is there a ANDROID_ADB_SERVER_ADDRESS or something similar ? Where can I find the definiton of such variables ?

I am basically running on a virtual machine while the device is connected to another machine's USB port where an instance of adb server is running, basically I would need the ADB client on my VM to communicate to such server, which is not running on the localhost as the default scenario requires - I guess.

Thanks,
Pietro




--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jags | 4 Aug 15:10 2015
Picon

accessibility settings change my app

Hi All,

There is a settings in accessibility section of android that reverse / invert colors. my app has some controls which have standard colors, which can't change , as they have semantic meaning, for example, signal stop red, signal careful - orange, signal ok-green

my question is, how to make my app accessibility settings - independent ?

do i get a notification in my app when accessibility settings are changed ?


i understand this is android-only forum, but i also need same solution for ios too.

regds
jags 

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
pedr0 | 4 Aug 11:06 2015
Picon

Manifest android:process field

Hi all,

I am using such field in the AndroidManifest file to unsure that an activity it's started as a separate process each time, I am using it in this way :


<activity ....
  android:process=":testprocess"
...
/>

Following the Android documentation the colon ":" should mean the activity will be started in a new private process each time, or at least it will not share the process with anybody else, quoting from the Android website:

"If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, is created when it's needed and the activity runs in that process"

What I see is that this is not happening all the time, actually it looks like the process is recycled to recreate the same activity, what I have done is to add a print right at the top of pretty much every on* activity's methods:

I am printing the object id and the process id obtained through

android.os.process.myPid();

Yes, I did not need it since the process id is printed out each time but I've realized it just now :-)


[...]
I/user  ( 9428): onCreate 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStart 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onResume 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStop 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStart 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onResume 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStop 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStart 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onResume 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStop 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStart 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onResume 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStop 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStart 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onResume 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStop 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStart 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onResume 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onStop 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onDestroy 9428 Object Activity <at> 41b5da18
I/user  ( 9428): onCreate 9428 Object Activity <at> 41b5cad8 <-- New activity created using the old process
I/user  ( 9428): onStart 9428 Object Activity <at> 41b5cad8
I/user  ( 9428): onResume 9428 Object Activity <at> 41b5cad8
[...]


Such behavior is not always consistent, it could as it could not happen and sometimes the activity is really started in a new process.


Anyway that gives me some troubles since, for no good reasons, a System.exit(0) is called at the end of the onDestroy() thus terminating the whole VM and preventing the activity from being created and restarted again, such bit was commented out during the tests I have made to make it possible for me to gather the traces and debug the issue.


Unfortunately I can't change such incorrect application behavior nevertheless I wonder if I have some other tricks to play from an application point of view which enables the activity to be restarted in a new process each time.

I wouldn't dislike for the sake of my own knowledge to be pointed where such behavior is implemented, where is the Activity created and started and where is decided to start it from a new process or not ?



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jags | 3 Aug 17:13 2015
Picon

font resizing help

Hi All,

I am using Avenir-Light.ttf font in my project which runs both in ios and android. The problem is font for same size looks smaller in android device. Also, in iPad font looks smaller than that of iphone.

Do i need to viewport / pixel density based font size calculation implemented ?

need a solution badly.

thanks in advance

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Pratama Nur Wijaya | 31 Jul 09:34 2015
Picon

Cutom Tab Indicator TabLayout Design Lib Support

Hi everyone, 

i want to make custom tab like these (see image)
http://www.awesomescreenshot.com/image/444876/fd1fdc0ed49b53f846b6b2282868235a

its look like instagram login page, 

i have try using Design Support Lib TabLayout 
but i dont have an idea how to custom tablayout indicator like that


any suggestion ?
Thanks before

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
shiva pendem | 30 Jul 22:26 2015
Picon

Android Application example

Hello, 

I need a android application where it will show two routes in first screen let say the route is from A to B and the second one is from C to D. and  below that i need a button to which asks for show on map, on clicking the button  it should show the two route maps in the new screen, here i will be sending 4 points that is 4 latitudes and 4 longitudes to next screen.

Can any one guide me how can i do this. my main moto or requirement is to show two routes for 4 different points as explained. 

Thanks,
Pendem Shiva Shankar,
Mob:+91-9533024675.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
tar9918 | 30 Jul 20:51 2015
Picon

AssertionError caused by okhttp on Android 5 only

This error only occurred on Android 5, mostly Samsung devices. URI scheme is https. com.b.a. in the 2nd sample is Picasso 2.2.


java.lang.AssertionError

at com.android.okhttp.OkHttpClient.getDefaultSSLSocketFactory(OkHttpClient.java:532)

at com.android.okhttp.OkHttpClient.copyWithDefaults(OkHttpClient.java:494)

at com.android.okhttp.OkHttpClient.open(OkHttpClient.java:467)

at com.android.okhttp.OkHttpClient.open(OkHttpClient.java:462)

at com.android.okhttp.HttpHandler.openConnection(HttpHandler.java:33)

at java.net.URL.openConnection(URL.java:479)

at com.android.volley.toolbox.k.a(HurlStack.java:102)

at com.android.volley.toolbox.a.a(BasicNetwork.java:96)

at com.android.volley.l.run(NetworkDispatcher.java:112)


Caused by: java.lang.AssertionError

      at com.android.okhttp.OkHttpClient.getDefaultSSLSocketFactory(OkHttpClient.java:532)

      at com.android.okhttp.OkHttpClient.copyWithDefaults(OkHttpClient.java:494)

      at com.android.okhttp.OkHttpClient.open(OkHttpClient.java:467)

      at com.android.okhttp.OkHttpClient.open(OkHttpClient.java:462)

      at com.android.okhttp.HttpHandler.openConnection(HttpHandler.java:33)

      at java.net.URL.openConnection(URL.java:479)

      at com.b.a.ay.a(UrlConnectionDownloader.java:58)

      at com.b.a.ac.a(NetworkBitmapHunter.java:46)

      at com.b.a.d.b(BitmapHunter.java:123)

      at com.b.a.ar.b(RequestCreator.java:225)

      at com.example.app.bq.a(UserManagerFragment.java:447)

      at com.example.app.bq.doInBackground(UserManagerFragment.java:414)

      at android.os.AsyncTask$2.call(AsyncTask.java:297)

      at java.util.concurrent.FutureTask.run(FutureTask.java:237)

      at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

      at java.lang.Thread.run(Thread.java:818)


Thanks in advance.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan Fajardo Roa | 30 Jul 03:55 2015
Picon

Alguien sabe porque me sale este error? Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
gvi70000 | 29 Jul 08:51 2015
Picon

avoid re adding items in list view

Hello all,

In my application i have a SlidingTabLayout, each tab containing a listview. when i go through the tabs several times the items are added in the listview each time. how can i prevent this behaviour?

the second question

On each tab i want to add a second fragment that will hold some controls, each fragment has to be linked with a list item from the list view, when i switch the tab the first list item has to be selected to display the corresponding fragment. How can i achieve this behavior?

my main activity
public class MainActivity extends AppCompatActivity {
    Toolbar toolbar;
    ViewPager viewPager;
    ViewPagerAdapter viewPagerAdapter;
    SlidingTabLayout slidingTabLayout;
    CharSequence Titles[] = {"Basic", "Sensors", "USB"};
    int Numboftabs = 3;

    <at> Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // Creating The Toolbar and setting it as the Toolbar for the activity
        toolbar = (Toolbar) findViewById(R.id.tool_bar);
        setSupportActionBar(toolbar);
        // Creating The ViewPagerAdapter and Passing Fragment Manager, Titles for the Tabs and Number Of Tabs.
        viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager(), Titles);
        // Assigning ViewPager View and setting the adapter
        viewPager = (ViewPager) findViewById(R.id.pager);
        viewPager.setAdapter(viewPagerAdapter);
        // Assiging the Sliding Tab Layout View
        slidingTabLayout = (SlidingTabLayout) findViewById(R.id.tabs);
        slidingTabLayout.setDistributeEvenly(true); // To make the Tabs Fixed set this true, This makes the tabs Space Evenly in Available width
        // Setting Custom Color for the Scroll bar indicator of the Tab View
        slidingTabLayout.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() {
            <at> Override
            public int getIndicatorColor(int position) {
                return getResources().getColor(R.color.tabsScrollColor);
            }
        });
        // Setting the ViewPager For the SlidingTabsLayout
        slidingTabLayout.setViewPager(viewPager);
    }

    <at> Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    <at> Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

my view pager adapter
public class ViewPagerAdapter extends FragmentPagerAdapter {

    CharSequence Titles[]; // This will Store the Titles of the Tabs which are Going to be passed when ViewPagerAdapter is created
    int NumbOfTabs; // Store the number of tabs, this will also be passed when the ViewPagerAdapter is created
    FragmentManager fragmentManager;
    private static final int tabIcons[] = {R.drawable.hand, R.drawable.sensors, R.drawable.fastobjects, R.drawable.gears, R.drawable.usb};
    // Build a Constructor and assign the passed Values to appropriate values in the class
    public ViewPagerAdapter(FragmentManager fm, CharSequence mTitles[]) {
        super(fm);
        this.fragmentManager = fm;
        this.Titles = mTitles;
        this.NumbOfTabs = mTitles.length;
    }
    //This method return the fragment for the every position in the View Pager
    <at> Override
    public Fragment getItem(int position) {
        Fragment fragment = fragmentManager.findFragmentByTag("android:switcher:" + R.id.pager + ":" + position);
        if (fragment == null) {
            Bundle arguments = new Bundle();
            arguments.putInt("position", position);
            arguments.putString("frag","android:switcher:" + R.id.pager + ":" + position);
            fragment = new Tab_Modes();
            fragment.setArguments(arguments);
            return fragment;
         }
        else
            return null;

    }
    // This method return the titles for the Tabs in the Tab Strip
    <at> Override
    public CharSequence getPageTitle(int position) {
        return Titles[position];
    }
    // This method return the Number of tabs for the tabs Strip
    <at> Override
    public int getCount() {
        return NumbOfTabs;
    }
}


and my listview creator

public class Tab_Modes extends ListFragment {
    private ArrayList<NameImg> items = new ArrayList<NameImg>();
    private int crtMode;
    <at> Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View v = super.onCreateView(inflater, container, savedInstanceState);
        Bundle arguments = getArguments();
        crtMode = arguments.getInt("position");
        Toast.makeText(getActivity(), "Crt Frag :" + arguments.getString("frag"), Toast.LENGTH_LONG).show();
        switch (crtMode) {
            case 0:
                items.add(new NameImg("Manual", "Simple camera Control", R.drawable.hand));
                items.add(new NameImg("Bulb", "Long Exposure", R.drawable.bulb));
                items.add(new NameImg("Time Lapse", "Frame by Frame Movie", R.drawable.timelapse));
                items.add(new NameImg("HDR", "High Dinamic Range", R.drawable.hdr));
                items.add(new NameImg("IR", "Infra RED Control", R.drawable.ir));
                break;
            case 1:
                items.add(new NameImg("Triggered", "Trigger camera ", R.drawable.triggrered));
                items.add(new NameImg("Dark Room", "Long Exposure", R.drawable.darkroom));
                items.add(new NameImg("Lightning", "Frame by Frame Movie", R.drawable.lightning));
                break;
            case 3:
                items.add(new NameImg("1", "USB1", R.drawable.usb));
                items.add(new NameImg("2", "USB2", R.drawable.waterdrops));
                break;
        }
        setListAdapter(new ModesItemAdapter(getActivity(), items));
        //ListView myLV  = null;
        //myLV = (ListView) myLV.findViewById(R.id.customListView);
        //myLV.setItemChecked(0, true);
        return v;
    }

        <at> Override
        public void onListItemClick(ListView l, View v, int position, long id) {
            super.onListItemClick(l, v, position, id);
            //getListView().setSelector(android.R.color.holo_blue_bright);
            //Toast.makeText(getActivity(), "selected item :" + position + " ID :" + id, Toast.LENGTH_LONG).show();
            FragmentManager fm = getFragmentManager();
            ModeControls myControls;
            myControls = (ModeControls) fm.findFragmentByTag(position + "ModesContent" );
            if (myControls == null) {//if the fragment dosen't exists we create it
                Bundle arguments = new Bundle();
                arguments.putString("myTxt", "selected item :" + position + " ID :" + id);
                FragmentTransaction ft = fm.beginTransaction();
                myControls = new ModeControls();
                myControls.setArguments(arguments);
                ft.add(R.id.main_activity, myControls).commit();
            }
        }
}

and my modes adapter - for my data structure

public class ModesItemAdapter extends ArrayAdapter<NameImg> {

    public ModesItemAdapter(Context c, List<NameImg> items) {
        super(c, 0, items);
    }

    <at> Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ItemView itemView = (ItemView)convertView;
        if (null == itemView)
            itemView = ItemView.inflate(parent);
        itemView.setItem(getItem(position));
        return itemView;
    }
}


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Terry | 29 Jul 08:32 2015
Picon

Google Ads Policy

We have just received an email from Google, with info about their new Ads Policy.

I am afraid that I do not understand much of it, and I know that trying to ask Google is a waste of time.
So I am trying to ask here instead. I am also sure that other developers have the same questions.

We have a few apps with normal AdMob Banner Ads.

- Do our Ads use AdSense?
- Do our Ads use DoubleClick?
- Do our Ads use Cookies?
- (Are we supposed to know these things?)
- Do we have to do anything to comply with this new policy?
- (Why cannot Google be clearer about this and spell out what we have to do - instead of using their usual vague formulations?)

Any help is appreciated.

Terry

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane