ads

Affichage des articles dont le libellé est Studio. Afficher tous les articles
Affichage des articles dont le libellé est Studio. Afficher tous les articles

jeudi 17 septembre 2015

Help with Android Studio.



Hi everyone!
Ill try to describe my problem as much as possible since I'm not very familiar with android studio and coding as well. More like noob in all this stuff - but I'm learning :)

So let's begin with the problem:
I have set up Android studio with java, all updates etc. and so far looks like all is done right. BUT!
Since I'm not hard coder and prefer to work in programs like wysiwyg there is small problem. I'm trying to create CM 12.1 theme by using source provided here : Cyanogenmod Theme Template
Everything is workin (at least I think so) fine but the problem is this:
scr1
scr2

Maybe that's the way it should be but I don't know. When i use folder /main/res/values/ ..... and put there color.xml with some color values then it shows visually colors on the left but when i copy exact the same file in /main/assets/overlays/com.android.systemui/res/values/ .... then you can see color check boxes dissapear.

My guess was that gradle somehow does not see this folder, or maybe this is really my stupid guess - well i am really confused PLEASE HELP :)



Help with Android Studio.



:confused:Hi everyone!
Ill try to describe my problem as much as possible since I'm not very familiar with android studio and coding as well. More like noob in all this stuff - but I'm learning :)

So let's begin with the problem:
I have set up Android studio with java, all updates etc. and so far looks like all is done right. BUT!
Since I'm not hard coder and prefer to work in programs like wysiwyg there is small problem. I'm trying to create CM 12.1 theme by using source provided here : Cyanogenmod Theme Template
Everything is workin (at least I think so) fine but the problem is this:
scr1
scr2

Maybe that's the way it should be but I don't know. When i use folder /main/res/values/ ..... and put there color.xml with some color values then it shows visually colors on the left but when i copy exact the same file in /main/assets/overlays/com.android.systemui/res/values/ .... then you can see color check boxes dissapear.

My guess was that gradle somehow does not see this folder, or maybe this is really my stupid guess - well i am really confused PLEASE HELP :)



lundi 14 septembre 2015

Android studio listview need to be visible



Hi guys I am new to developing i need help with some codes. :) Hope you guys can help.

I am using Sqlite database i need to create a list view that display the word from database so hope you guys can help me. here is my code above. ty




//Code
public class Ortho extends ActionBarActivity {

private final String TAG = "Ortho";
DatabaseHelper dbhelper;
TextView word;
TextView mean;
AutoCompleteTextView actv;
Cursor cursor;
Button search;
int flag = 0;
ListView ls;
ArrayList<String> dataword;


@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ortho);

ls = (ListView) findViewById(R.id.mainlist);
ls.setVisibility(View.VISIBLE);
//need code here



dbhelper = new DatabaseHelper(this);
try {
dbhelper.createDataBase();
} catch (IOException e) {
Log.e(TAG, "can't read/write file ");
Toast.makeText(this, "error loading data", Toast.LENGTH_SHORT).show();
}

dbhelper.openDataBase();

word = (TextView) findViewById(R.id.word);
mean = (TextView) findViewById(R.id.meaning);



String[] from = {"english_word"};
int[] to = {R.id.text};
actv = (AutoCompleteTextView) findViewById(R.id.autoCompleteTextView);
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.singalline, null, from, to);


// This will provide the labels for the choices to be displayed in the AutoCompleteTextView
adapter.setCursorToStringConverter(new SimpleCursorAdapter.CursorToStringConverter() {
@override
public CharSequence convertToString(Cursor cursor) {

return cursor.getString(1);
}
});
adapter.setFilterQueryProvider(new FilterQueryProvider() {
@override
public Cursor runQuery(CharSequence constraint) {
cursor = null;
int count = constraint.length();
if (count >= 1) {
String constrains = constraint.toString();
cursor = dbhelper.queryr(constrains);

}

return cursor;
}
});



mardi 8 septembre 2015

The Wrong Activity Shows Up Android Studio



Can anybody help me. I have developed a quiz app. At the end of the quiz the result activity must show up but the scores activity shows up. The scores activity only shows up when the scores button is selected on the MainActivity.

Quiz.java


Code:


package app.mobiledevicesecurity;

import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.media.MediaPlayer;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Quiz extends Activity
{
    List<Question> questionList;
    int score = 0;
    int qid = 0;
    Question currentQuest;
    TextView txtQuestion, scored;
    Button button1, button2, button3;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_quiz);
        QuizHelper db = new QuizHelper(this);
        questionList = db.getAllQuestions();
        currentQuest = questionList.get(qid);
        txtQuestion = (TextView) findViewById(R.id.txtQuestion);

        button1 = (Button) findViewById(R.id.button1);
        button2 = (Button) findViewById(R.id.button2);
        button3 = (Button) findViewById(R.id.button3);

        scored = (TextView) findViewById(R.id.score);



        setQuestionView();

        button1.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v) {
              getAnswer(button1.getText().toString());
            }
        });

        button2.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v) {
                getAnswer(button2.getText().toString());
            }
        });

        button3.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v) {
                getAnswer(button3.getText().toString());
            }
        });
    }
    public void getAnswer(String AnswerString)
    {
        if (currentQuest.getAnswer().equals(AnswerString))
        {
            score++;
            scored.setText("Score : " + score);
        }
        else
        {

            Intent intent = new Intent(Quiz.this,
                    Result.class);
            Bundle b = new Bundle();
            b.putInt("score", score);
            intent.putExtras(b);
            startActivity(intent);
            finish();


        }
        if (qid < questionList.size()) {
            currentQuest = questionList.get(qid);
            setQuestionView();
        }
        else
        {

            Intent intent = new Intent(Quiz.this,
                    Result.class);
            Bundle b = new Bundle();
            b.putInt("score", score);
            intent.putExtras(b);
            startActivity(intent);
            finish();


        }
    }

    private void setQuestionView()
    {
        txtQuestion.setText(currentQuest.getQuest());
        button1.setText(currentQuest.getOption1());
        button2.setText(currentQuest.getOption2());
        button3.setText(currentQuest.getOption3());
        qid++;
    }
}


Result.java

Code:


package app.mobiledevicesecurity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Result extends Activity {

    private static Button playbtn;
    private static Button menubutton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        OnClickPlayButtonListener();
        OnClickMenuButtonListener();
        TextView textResult = (TextView) findViewById(R.id.textResult);
        Bundle b = getIntent().getExtras();
        int score = b.getInt("score");
        textResult.setText("You scored" + " " + score + " for the quiz.");

        Intent intent2 = new Intent(Result.this,
              Scores.class);
        Bundle bun = new Bundle();
        bun.putInt("score", score);
        intent2.putExtras(bun);
        startActivity(intent2);
        finish();
    }

    public void OnClickPlayButtonListener() {
        playbtn = (Button) findViewById(R.id.btn);
        playbtn.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent = new Intent("app.mobiledevicesecurity.Quiz");
                        startActivity(intent);
                    }
                }
        );
    }

    public void OnClickMenuButtonListener() {
        menubutton = (Button) findViewById(R.id.menubtn);
        menubutton.setOnClickListener(
                new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent = new Intent(getApplicationContext(), MainActivity.class);
                        startActivity(intent);
                    }
                }
        );
    }
}


Scores.java

Code:


package app.mobiledevicesecurity;

import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.content.Intent;

public class Scores extends ActionBarActivity {

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

        TextView txtScore1 = (TextView) findViewById(R.id.txtScore1);
        Bundle bun = getIntent().getExtras();
        int score = bun.getInt("score");
        txtScore1.setText("score:" + " " + score + " for the quiz.");
    }

    @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_scores, menu);
        return true;
    }

    @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);
    }
}





vendredi 4 septembre 2015

Cntrl + click not working in Android studio



I am new to Android Studio.I like the IDE very much,it has got some nice set of features and has a rich look and feel, however I have some issues with the IDE. I recently created a Cordova application in android studio.I created an HTML file called index.html under assests/www folder.I included my jquery-1.11.3.min.js inside index.html file.I have the habit of checking whether the file jquery-1.11.3.min.js has been correctly included inside HTML file.In eclipse I use cntrl +click to check whether the js file path given is right.But when I use the same thing in Android studio,even if the path is right,it is showing like 'Cannot find declaration to go to'.Please help me on this.



lundi 31 août 2015

Error compiling Android Studio



I was translating an app and I did everything right ...

Decompile the apk
Translate app (res / values / string.xml)
And I compile again

But now the time to compile the following error appears "ERROR: Android Generator Source: [project] Package is not specified in AndroidManifest.xml"

What to do? I did not change anything beyond the translation.



Reverse engineering an app in Apk Studio.



I'm trying to add an option in an app called aizoban that you could find on fdroid. It's a manga app. What I'm trying to do is add the website goodmanga.net to the app in the settings. How do i add a website's address and link to the manga source options?



samedi 29 août 2015

Error When Starting Android Studio



When I start up Android Studio, I get this terrifying error message

Start failed: Internal error. Please report to code-google-com

java.lang.RuntimeException: java.lang.IllegalArgumentException: Argument for @NOTNull parameter 'name' of com/android/tools/idea/welcome/Platform. must not be null at com.intellij.idea.IdeaApplication.run(IdeaApplicat ion.java:178) at com.intellij.idea.MainImpl.run(MainImpl.java :52) at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:756) at java.awt.EventQueue.access0(EventQueue.java:97) at java.awt.EventQueue.run(EventQueue.java:709) at java.awt.EventQueue.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessI mpl.doIntersectionPrivilege(ProtectionDomain.java: 76) at java.awt.EventQueue.dispatchEvent(EventQueue.java: 726) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEv entQueue.java:362) at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:82) Caused by: java.lang.IllegalArgumentException: Argument for @NOTNull parameter 'name' of com/android/tools/idea/welcome/Platform. must not be null at com.android.tools.idea.welcome.Platform.(Platform. java) at com.android.tools.idea.welcome.Platform.getLatestP latform(Platform.java:72) at com.android.tools.idea.welcome.Platform.createSubt ree(Platform.java:89) at com.android.tools.idea.welcome.InstallComponentsPa th.createComponentTree(InstallComponentsPath.java: 81) at com.android.tools.idea.welcome.InstallComponentsPa th.init(InstallComponentsPath.java:215) at com.android.tools.idea.wizard.DynamicWizardPath.at tachToWizard(DynamicWizardPath.java:97) at com.android.tools.idea.wizard.DynamicWizard.addPat h(DynamicWizard.java:233) at com.android.tools.idea.welcome.FirstRunWizard.init (FirstRunWizard.java:75) at com.android.tools.idea.welcome.FirstRunWizardHost. setupWizard(FirstRunWizardHost.java:100) at com.android.tools.idea.welcome.FirstRunWizardHost. getWelcomePanel(FirstRunWizardHost.java:92) at com.intellij.openapi.wm.impl.welcomeScreen.Welcome Frame.(WelcomeFrame.java:68) at com.intellij.openapi.wm.impl.welcomeScreen.Welcome Frame.showNow(WelcomeFrame.java:173) at com.intellij.idea.IdeaApplication$IdeStarter.main( IdeaApplication.java:302) at com.intellij.idea.IdeaApplication.run(IdeaApplicat ion.java:172) ... 16 more


I have already set the environment variable of JDK_HOME with the value as the destination of JDK

I have uninstalled and reinstalled many times, and I have even reset my PC

Any help would be appreciated :) -Pingu



Hardbricked my BLU Studio 5.0II



Hey guys, I believe I have hardbricked my BLU Studio 5.0II D532U.
It cannot turn on, and the computer will not detect it.
This happened because I accidentally downloaded a new Preloader.bin using SPFlashTools.

Can anyone help, or is my phone really a dead cause expensive piece of brick?
Thanks :<



Publishing an app with Android Studio made in Unity. Generate APK button faded.



I have made a game with the Unity Engine. Now that I have published the game to Google Play I have noticed that there are some permissions I don't want that unity adds by default. I want to remove them but Unity doesn't allow me to edit the AndroidManifest file.

I've been told to use Android Studio for that. I have no experience and have no idea how to use it. I have managed edited the android manifest to remove the permissions that I don't need, now I want to sign and publish the Apk from android studio, however there is a problem.

When I go to the Build menu the "Generate signed APK" button is disabled and faded out so I can't click it. What do I need to do in order to click this button, sign the app and upload it to the play store?

It may also be worth mentioning that the android section of the project view on the side shows no files, files are only shown after pressing "Project" in the top left drop down. I have no idea if this is normal due to lack of experience.



vendredi 28 août 2015

Blu Studio 5.5K d710 stock



I have no clue where else to post this as there is nearly zero support for most of these Blu devices. They seem to be some of the worst devices for boot looping after a factory reset. What's the first thing Blu customer service (laughable) will tell you to do in the event of boot loop? Factory reset. Absolutely ridiculous. What do they tell you if you cut straight to the point and ask for the stock firmware? Factory reset. So, my question, if it's allowed is does anyone have access to the stock firmware for this device? I know it's a long shot, at best. Thanks in advance and I apologize if this was not this appropriate place to post this.

Sent from my HTC6535LVW using XDA Free mobile app



mercredi 26 août 2015

Blu Studio 5.5s Cyanogenmod 12.1 Need Help



I Need Help Putting Cyanogenmod 12.1 On My Blu Studio 5.5s ,It's Not Supported By Cynogenmod But I Was Wondering How To Do It When It's Not Supported, I Do Have Experience With Cynogenmod, I Have Flashed It On To My Old Motorola Triumph Back When Cynogenmod 9 Was Out