peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Why would you want to do such horrible think as on button click add another spinner? That is how websites works when you are searching for a product for example. In Android we do reuse views when need it and this is excellent example.

Let user select whatever he wants, save selection in sharedprefferences or other storage of your choice. Fetch new set of data, clean adapter and push new data to spinner.Job done!

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is no such component in Android such as GifWebView.SO you better ask whereever you found this...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can't communicate with localhost as Android is unable to resolve it. If you can get your server on proper internet recognised IP then you HttpClient provided by Android SDK or any of the http libraries

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@arronlee another link to your website and it will be ban

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@arronlee you just bumped 2 years old thread, with C# link to comercial product. I would not recommend to do it again.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@elsunhoty you better read forum rules specially

Do not ask about obtaining pirated software, nor link to it

@dany12 Starting "Java" on top this section is full of valuable input

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Top of Java section Java projects for learners just wondering how you missed that

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@anas.man you may misunderstand question

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can use either Android provided JSON capabilities (little cruel and long winded) or you can use any of number of open source libraries like Gson, Jackson that let you easily parse json to specific class

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You may consider using JSOUP library for parsing html. Better then doing "by hand"

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Any reason you are not using CursorAdapter? Vogella has nice tutorial with SimpleCursorAdapter

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@bCubed you sure your link is valuable?

Learn Java Tutorial 1.4- Using the while loop to bark for awhile..

I would call it way out of date given Java 6 is slowly replaced by Java 7 and Java 8 is just behind corner

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Forum rules

Do provide evidence of having done some work yourself if posting questions from school or work assignments

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Netbeans have reasonably good and up-to-date tutorials

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@cool_zephyr I will say it is everyone personal opinion/preference how to proceed. Because as to your recommendation I can say "why to bother with file read/write logic when there is already database connectivity?"

@CoilFyzx it is difficult to give deceisive answer without knowing more about functionality of your application.

1st point, as ong there is no heavy data processing (thousands of entries to go through before displaying result, which means delay before user sees anything) you more then safe to do it on each read

2nd point, you may create special table to hold data of last seen UI, simple if working with single UI view (school assignmen). However that may be impractical if you have multiple UIs you will require number of such tables.

For 3rd point implementation is really up to you if you want to keep config file or database config table, same goes for credentials

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

It would be beneficial to other users to give quick explanation how you solved issue instead of just closing. Don't you think?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

People may have suggested SharedPreferences because

A. You may want to keep login credentials for future logins, so whenever user encounters login form this will get populated by them and user then only need to press login button to trigger login process of validation and verification
B. You may want to store a token that identifies you as valid logged user, so for future communication with remote service you can safely communicate

PS: Would be also nice of you in future close some topics and give creadit where due example here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

BTW you should be using Java 1.6 as that what Android SDK is build with as there are some issues when using 1.7 It will work fine with simple apps but when you get to point that you need reflection and casting you may run into issues.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

It's showing 2 errors at br.readLine()

Because line 11 and 13 are supposed to be br.readLine() where you have br.readline

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Post whole error not portion and maybe someone may help you...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm missing your point. You talk about developing Android app and then jumps on 3rd party frameworks. You want Android SDK then download from here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1) You need to post full stacktrace of the error not single line you provided above
2) new Intent need start with context getContext()

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Having embedded database inside your project doesn't guarantie that it will work everywhere. Do you have any checks run on your database to determinate that all tables been created/do exist before your let user to do anything?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

pritaeas any specific reason why you want to use 3rd party library that is mix of HTML5 and Ajax instead of native Android code base?

Both frameworks will be always slower then native code, they are more likely introduce various bugs, and they always behind current Android development.

As for the IDEs I do use Android Studio on daily bases and does work great as long you are using Gradle as your build automation tool. However you have to remember this is not official release therefore some stuff is missing like multi module testing, project test coverage

IntelliJ is more round-up IDE given that has longer history (Android Studio is base on IntelliJ so it inheritted lot of good stuff). However advantage of IntelliJ is support of Ant, Maven and Gradle build tools, support for multi module testing and coverage with Cobertura, Emma and Jacoco.

Nevertheless I'm not sure if either of these IDEs support Phonegap or Xamarin.

Sorry if I gave negative opinion on above frameworks, but I'm native Android dev and not really friend of these "cross platform" frameworks

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@Makcarov please think twice before you post off topic answer. Question is how to communicate with server, not what type of server to use!

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@thorin sorry you are wrong as you need also JsonParser and JsonObject that are part of this library

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well you want to display some info on your GUI. Therefore you need to provide it with some data through your constructor, or make setter methods to set label and text area
If not clear you better read some book or Oracle tutorial

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Just for benefits of community here is sample

{name: "peter_budo", userGroup: ["user", "moderator"]}

For this you would require class something like this

public class User {
    @SerializedName("name")
    private String name;
    @SerializedName("userGroup")
    private List<String> userGroups = new ArrayList<String>();

    public String getName() {
        return name;
    }

    public List<String> getUserGroups() {
        return userGroups;
    }
}

JSON will come over HttpClient or similar as a String. In order to get it converted to Java object you have to first parse string to get JsonObject and after it with help Gson class you can cast it to your class type

private User parseJson(String json) {
    JsonParser parser = new JsonParser();
    JsonObject userJson = parser.parse(json).getAsJsonObject();
    Gson gson = new Gson();
    User user = gson.fromJson(userJson, User.class);
    return user;
}
~s.o.s~ commented: Upvote for the benefit of Peter ;) +14
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You better contact author of that library as he is more likely to provide yu with faster reply http://baijs.nl/tinyscrollbar/

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

From your device sent HTTP request (GET/POST) to server. Server process the request and fetches data for you, transfers data to JSON format and send it as reply that you should be able to use. Server side technology can be anything like PHP, Java servlets etc, that is capable of producing JSON object

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not standard Android error, guess Cordova is behind with support of latest Android OS. You should ask on Cordova mailing list.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well you will need to show at least 2 UI components main text area where game would display info and an input field to get user input for decisions in the game. Wouldn't you...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry @jrosh but that is not have the forum works "I have problem here is all the crap, deal with it for me because I cannot be bothered". Just because you show some link it doesn't mean you provided evidence of some work as per rules

Do provide evidence of having done some work yourself if posting questions from school or work assignments

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Can you post code for both activities? From above it is not clear what is happening inside app

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

TextView.setText(SOME_TEXT_HERE) what is difficult about that?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is a book Beginning J2ME: From Novice to Professional that has very good exampleof database connectivity in chapter 10 also if you search forum you should be able to find previous threads in regards of it (most likely answerd by me, but I do not do j2me development anymore)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Given that 5 years ago I written [JSP database connectivity according to Model View Controller (MVC) Model 2] (http://www.daniweb.com/web-development/jsp/threads/141776/jsp-database-connectivity-according-to-model-view-controller-mvc-model-2)tutorial that sits on top of the JSP section it still amazes me that people are putting connectivity inside of JSP and making mess of such basic task

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1) Force landscape layout
2) Redisign your portrait layout

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Encaupsulate radio buttons with radio group, that is radio group purpose

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Search for public API availability, if none available you should contact manufacturer

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is some options in building Android app with JavaScript bt I never explored them. If you want native app you should use Java for Android or Objective C for iPhone. There are some products on the market like PhoneGap that help you beuld for multiple platforms, but apps developed through them are margingly slow

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@asif49 PhoneGap, you just made me cry. You should really use native code not some framework that is trying to emulated native environment. It never gone be on same technical level

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can always create zip file, download it when dedicated directory not existent on phone system. You should also look up some image loader library like Novoda ImageLoader to help you with image fetching from resources

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

no I said use on onResume() because onCreate is only executed when activity or fragment is started for first time, but it is not executed when coming back from pause state that mean user moved on different activity or fragment and then he decide to press back button, or perhaps your application was pause down to call or received SMS and user does return back to it and application is started from last know state and that state start with resume. Read on Activity lifecycle here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No not possible once you give it fixed value. However you can use layout_weight to make device strech it dynamically. If you ever did any web development with CSS you should find many similarities.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I cannot answer thi question as I never played with widgets layouts, but you can have look over here http://developer.android.com/guide/topics/appwidgets/index.html

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Android SQLite database and content provider - tutorial by Lars Vogel

And yes onResume is better

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

The XML option does allow you setup listener that calls on custom method so in some cases it may look more straight forward in the way say on click of this button do some function execution.
However most developers use setOnClickListener where it is obvious from class that it does implements OnClickListener or you have it attached as inner class to button onClickListener setter.
There is not clean declaration in documentation when to use this or that, but as I said second option is more popular and common.