*sharath* 0 Junior Poster in Training

I am already having many images which are having size of around 5 Mb. Adding few more images may increase the size. So is there any other alternative or could you suggest any sample for this if possible

*sharath* 0 Junior Poster in Training

I know that the issue can be solved by using a 9 patch as background.
Suppose am using a 9patch as background.. could you help me in changing its color to someother (supposing that there are few buttons for changing colors).
And even am aware to draw it on canvas. The issue is how to do that as i am not able to find out how to draw the tip pointing onto the canvas

*sharath* 0 Junior Poster in Training

Well i dont want to use the image at all.
I just need is the way to create some custom view to look like the image so that i can have a way to pass a parameter to the constructor or any method to create some other view with some different color instead of using the same image all the times. Hope i am clear now.

*sharath* 0 Junior Poster in Training

Thanks for the reply.
But my problem is not with the image and making it .9.png format.
I want a way to design a view (custom view ) which resembles the image.

*sharath* 0 Junior Poster in Training

Does any one have any idea of creating a custom component like the below image instead of using the image itself. I know how to create a rectangle (a rounded one using the xml and not in java) which was discussed in the most of the links but i am not able to work with something like the pointer part.

does anyone have an idea to do this i would be happy if i am suggested.

*sharath* 0 Junior Poster in Training

I am trying to dynamically resize an image which is in the relative layout using the code

int height = v.getHeight();
   int width = v.getWidth();
height += 50;
width += 50; 
RelativeLayout.LayoutParams layout = new RelativeLayout.LayoutParams(height, width);
layout.setMargins(200, 200, 200, 200);
layout.addRule(RelativeLayout.CENTER_IN_PARENT);
    v.setLayoutParams(layout);

The rule works perfectly. The image gets placed in the center but what i want to get is the image should be placed where it is. That is if the image is at the location (100,100) it's size should be increased and the image should be placed at the same location or the location where i need to place it. Can anyone suggest me please.

*sharath* 0 Junior Poster in Training

Can anyone give a simple example for GCM server and how to use it.
Thanks in advance

*sharath* 0 Junior Poster in Training

Quoted Text Here

It just means that scanf won't return until the user has entered another token

does this mean that the user needs to enter another input (may be a string or an integer or so) so that the scanf returns?

*sharath* 0 Junior Poster in Training

I am using a json function to parse a link and return a json object.
the code is below :

public JSONObject getJSONFromUrl(String url) {

        // Making HTTP request
        try {
            // defaultHttpClient
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(url);
            Log.v("url", " " + url);
            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity httpEntity = httpResponse.getEntity();
            is = httpEntity.getContent();           

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    is, "iso-8859-1"), 8);
            StringBuilder sb = new StringBuilder();
            String line = null;
            while ((line = reader.readLine()) != null) {
                Log.v("data", " " + line);

                sb.append(line + "n");
            }
            is.close();
            json = sb.toString();
        } catch (Exception e) {
            Log.e("Buffer Error", "Error converting result " + e.toString());
        }

        // try parse the string to a JSON object
        try {
            jObj = new JSONObject(json);
        } catch (JSONException e) {
            Log.e("JSON Parser", "Error parsing data " + e.toString());
        }

        // return JSON String
        return jObj;

    }

present in the link Click Here

but its not working for the linkClick Here

Its giving me no data found warning
please suggest me

*sharath* 0 Junior Poster in Training

i tried the code for GCM given in the link Click Here
Using this i am able to get the registration id for my application (i checked on the device and found it got printed onto the textview that i set).

But now how can i check for the receiving of messages(push notifications) from the server.
Actually how to connect my code to the server ?
Can anyone help me please.
Thanks in advance.

*sharath* 0 Junior Poster in Training

the problem is solved.
i initialised the bitmaps which i am displaying during the process with null and used later.
This helped in solving the issue.

*sharath* 0 Junior Poster in Training

I found that this is a paid service.
But do we have any other way to use google translator?

*sharath* 0 Junior Poster in Training

how can i check logcat in mobile?

*sharath* 0 Junior Poster in Training

I am trying to look into localization in android.
I tried working with ttf files.
But now i am having a doubt.
If the data is not static say i am having a edit text and a button and the user will enter some text in english and click on a button to convert the entered text into hindi.

As the user may enter any word he needs so i think its not possible to place all the words into the strings xml file.
I got an idea that i must use google translator.
But is there any other way to do this?
Or else how can i use this google translator into my application? (i didnt get any service links for google translator)
Can anyone help me please.
Thanks in advance.

*sharath* 0 Junior Poster in Training

ok thanks for the information.
So i understood that the number of classes wont effect the speed but passing of information between classes matter.
Thank you.

*sharath* 0 Junior Poster in Training

does the passing of arraylists effect the speed?

*sharath* 0 Junior Poster in Training

Any how i think its against to the free usage of user but when i am trying to use onclick on the tab i am unable to understand how to move further.

(i am using this as a reference to create tabs Click Here)

*sharath* 0 Junior Poster in Training

yes i too agree with peter budo.
But i am trying to use double click (which is similar to iphone default implementation)
i thought A project done in iphone and in android will be similar which will be easy for the user.

And i tried the thing you said previously.
I checked which tab is currently on focus and if the first tab is in focus i am making a boolean value true and next if i am on the second tab i am making it false.
But i found its not working.

*sharath* 0 Junior Poster in Training

Isnt this possible or is it that we should not implement double touch on tabs in android ?

*sharath* 0 Junior Poster in Training

i tried some code to download the images using external storage concept and file cache.
It works fine in samsung mobile but it crashes in HTC.
What might be the reason?

*sharath* 0 Junior Poster in Training

The data is from the service .
I am passing an array list to set a custom adapter like

mListview.setAdapter(new MyCustomAdapter(this , array_List));

I am having 4 activities where i need to set a custom adapter and i used the custom adapter in a seperate class file (like MyCustomAdapter.java) rather using it in the same file where i wrote the activity.

*sharath* 0 Junior Poster in Training

And does passing array lists between classes show any impact on speed?

My problem is I am using seperate adapter classes and created an application.
But my team lead asked me to reduce the number of classes because it effects the speed.

*sharath* 0 Junior Poster in Training

Does the number of classes show any impact on the speed of an application?

For example if there are more number of classes (or packages) does it make the application to run slow compared to the one that has less number of classes (or packages)?

Thanks in advance.

*sharath* 0 Junior Poster in Training

Thanks for the reply peter budo.
i am having two tabs in which there is some content (and a series of activities).
When i click on a tab it should give its particular content.
And when i double click on the first tab it should show the first activity.
Should we use the concept of double click ?

*sharath* 0 Junior Poster in Training

can i know how can we use a double touch on tabs in android.
I found that onclicklistener and onlongclicklistener are not working for tabs. so now am in need of a double touch on tabs.
Thanks in advance.

*sharath* 0 Junior Poster in Training

You can use a character array to do this task.
and scanf("%[^\n]",strName); means that the user can enter a name and if he completes his name he need to enter a new line.
by default a scanf() considers a space character as a delimiter.
By using the [^\n] , we are changing the delimiter to a new line character.

*sharath* 0 Junior Poster in Training

thank you

*sharath* 0 Junior Poster in Training

they are about 480 *360

*sharath* 0 Junior Poster in Training

am using an emulator.

*sharath* 0 Junior Poster in Training

yes i used them and also included fine location.

*sharath* 0 Junior Poster in Training

a[] is an array.
arrays decays into pointers.
for example if we are having a[i], it decays into *(a+i) as far as i know

*sharath* 0 Junior Poster in Training

I checked this in mobile.
But i am getting a toast of Native service not found.
What should i do now?

*sharath* 0 Junior Poster in Training

i am using the following code to get the latitude and longitude values of a particular area.

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        List<Address> foundGeocode = null;
        /* find the addresses  by using getFromLocationName() method with the given address*/
        try {
            foundGeocode = new Geocoder(this).getFromLocationName("Hyderabad", 1);
            foundGeocode.get(0).getLatitude(); //getting latitude
             foundGeocode.get(0).getLongitude();//getting longitude
             Toast.makeText(this, ""+ foundGeocode.get(0).getLatitude()+"   "+foundGeocode.get(0).getLongitude(), 20).show();

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

But the catch block is being executed instead of getting the latitude and longitude values.
Can any one help me out.

I sent values to emulator using the ddms view and later tried to work out this code.
i am getting the following warning.

07-13 09:05:13.390: W/System.err(368): java.io.IOException: Service not Available

thanks in advance.

*sharath* 0 Junior Poster in Training

Thanks for the reply.
Isnt there any way to manually write the code to capture instead of using the service?

So what i understood is to use the service "ScreenshotService" class in my application.
But i didnt find where the service is being called in the button onclick listener.
i found that it is called right in the oncreate method. Then how does the service captures the image on the button click?

Thanks in advance.

*sharath* 0 Junior Poster in Training

I am having a video running.
and when i pause the video and click on capture button the screen should be captured.
how can this be done?
i tried the following code to capture but its taking a blank picture.

View v1 = myVideoView.getRootView();
                System.out.println("Root View : "+v1);
                v1.setDrawingCacheEnabled(true);
                Bitmap bm = v1.getDrawingCache();
                display_image.setImageBitmap(bm);
                System.out.println("Bitmap : "+bm);

please suggest me a way.
Thanks in advance

*sharath* 0 Junior Poster in Training

the above one is working fine only for few times.

*sharath* 0 Junior Poster in Training

i found this line which helped to get out of my problem.

 Bitmap.createScaledBitmap(myBitmap,100,100, true);

But i am not sure whether to use this or not.
can anyone say whether this statement safe to use?
thanks in advance.

*sharath* 0 Junior Poster in Training

i saw that in android 4.0 we are having an inbuild calender.
But can we use the same (in any way) for any lower versions

*sharath* 0 Junior Poster in Training

this code displays different solutions on different compilers. Both showed me different answers.
So i too feel it as an undefined behaviour.

*sharath* 0 Junior Poster in Training

Thanks peter budo and sorry to bother you again (just wanted to know each and every thing completely so that i could explain the same to others who find difficulty in this)
1. then what is this code?

<net.peterkuterna.android.apps.swipeytabs.SwipeyTabs
        android:id="@+id/swipeytabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        swipeytabs:bottomBarColor="#ff96aa39"
        swipeytabs:bottomBarHeight="2dip"
        swipeytabs:tabIndicatorHeight="3dip"
        android:background="#ff3b3b3b"/>

Is this the code similar to using a google map?
i mean we are having some code given by google to display maps.
Is it the same?

  1. and even i am not having any view like viewpager instead am having few views like viewflipper ,viewanimater and viewswitcher..
    can i know how to use this code

    <android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="fill_parent"
    android:layout_height="0px"
    android:layout_weight="1" />

Thanks in advance.

*sharath* 0 Junior Poster in Training

thanks peter budo..
does Async task concept is the same as using something like queue (actually i am not aware of that concept but i googled it and found a huge code Click Here for this image loading)??.
Is there any other way to do this task?

will a thread at the place of loading the image help in solving my problem?
I tried using a thread and a run() for loading image from the URL and set it to the image view.
It seemed to work for the first time and again when i go to the apps and restart the app its not getting loaded as it did the first time.

Thanks in advance

*sharath* 0 Junior Poster in Training

what are the projects that have been turned into libraries??
can i know them please..
i looked at the project (link that u provided me) and also the following link
http://caughtinthemobileweb.wordpress.com/2011/06/20/how-to-implement-calendarview-in-android/
please let me know how can i use the libraries into mine??
Is it the same way like importing them into my apps and using them??

Thanks in advance.

*sharath* 0 Junior Poster in Training

what are the existing components?
which i use for zooming ?
And there is a zoom control in the views. Does this help in anyway?
I searched google to find out the way to use this control but i didnt find any info except the information from the developer site..
can i know how this can be used.
Thanks in advance.

*sharath* 0 Junior Poster in Training

what is this extra line used in the xml layout in the link??

xmlns:swipeytabs="http://schemas.android.com/apk/res/net.peterkuterna.android.apps.swipeytabs"
*sharath* 0 Junior Poster in Training

Thanks peter budo.
I will try that post.

*sharath* 0 Junior Poster in Training

i understood how to drag or how to zoom the image using a touch.
but when am using a button i am not able to find out the way how to zoom the image using the same as done for using a touch.

*sharath* 0 Junior Poster in Training

so we have to create a seperate project that displays the calender as i want it to do and use that project in any of the other projects in which i want that calender to be displayed?

*sharath* 0 Junior Poster in Training

I am using sax parser in android and i am displaying the content parsed into a custom list view which even contains an image.
The image is loading very slowly and thereby my list which contains 10 elements are displayed after few minutes and even if the list loads to scroll the image its taking time saying that My SAX parser app is not responding.
Is there any way to make the images to display fast and make the app respond properly on scrolling the list?
Thanks in advance.

*sharath* 0 Junior Poster in Training

thanks peter budo
i read those links from google but i didnt find them helpful because i didnt understand most of the code.

can u help in any other way please.

*sharath* 0 Junior Poster in Training

Thanks for the reply peter budo
I am trying to use tabs and activity groups and found an example where the entire code is used.
i didnt understand it and so i thought to get some knowledge about the lines and start the work on it.

can u give me few useful links how fragments are used and why they are used