Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2018-10-18 20:48:46.629 2262-2814/? E/ajkt: Phenotype API error. Event # bqfx@a7bff772, EventCode: 7 [CONTEXT service_id=51 ]
- ajjn: 29505: No config packages for log source, or config package not registered
- at ajlg.a(:com.google.android.gms@14367040@14.3.67 (100700-216465562):51)
- at ajlf.b(Unknown Source:2)
- at ajkt.a(:com.google.android.gms@14367040@14.3.67 (100700-216465562):105)
- at ajkt.a(:com.google.android.gms@14367040@14.3.67 (100700-216465562):99)
- at xaj.run(:com.google.android.gms@14367040@14.3.67 (100700-216465562):27)
- at bedi.run(:com.google.android.gms@14367040@14.3.67 (100700-216465562):2)
- at qfl.run(:com.google.android.gms@14367040@14.3.67 (100700-216465562):35)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
- at qlf.run(Unknown Source:7)
- at java.lang.Thread.run(Thread.java:764)
- 2018-10-18 20:48:46.630 2262-2814/? E/AsyncOperation: serviceID=51, operation=GetExperimentTokensOperationCall
- OperationException[Status{statusCode=No config packages for log source, or config package not registered, resolution=null}]
- at ajkt.a(:com.google.android.gms@14367040@14.3.67 (100700-216465562):113)
- at ajkt.a(:com.google.android.gms@14367040@14.3.67 (100700-216465562):99)
- at xaj.run(:com.google.android.gms@14367040@14.3.67 (100700-216465562):27)
- at bedi.run(:com.google.android.gms@14367040@14.3.67 (100700-216465562):2)
- at qfl.run(:com.google.android.gms@14367040@14.3.67 (100700-216465562):35)
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
- at qlf.run(Unknown Source:7)
- at java.lang.Thread.run(Thread.java:764)
- package com.blogspot.andrdoc.guessthecelebrity;
- import android.graphics.Bitmap;
- import android.graphics.BitmapFactory;
- import android.os.AsyncTask;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.util.Log;
- import android.view.View;
- import android.widget.ImageView;
- import android.widget.TextView;
- import android.widget.Toast;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.net.HttpURLConnection;
- import java.net.URL;
- import java.util.Random;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import javax.net.ssl.HttpsURLConnection;
- public class MainActivity extends AppCompatActivity {
- String toast;
- ImageView myimage;
- TextView options;
- TextView toption1;
- TextView toption2;
- TextView toption3;
- TextView toption4;
- Bitmap heroimg;
- String result;
- String heroimagelink;
- String rightheronames;
- String userchoice;
- String option1;
- String option2;
- String option3;
- int t=0;
- int i=1;
- int x=1;
- private class Downloadbackground extends AsyncTask<String, Void, String> {
- @Override
- protected String doInBackground(String... strings) {
- URL url;
- HttpURLConnection httpconnect = null;
- try
- {
- url = new URL(strings[0]);
- httpconnect = (HttpURLConnection) url.openConnection();
- InputStream in = httpconnect.getInputStream();
- InputStreamReader reader = new InputStreamReader(in);
- int data = reader.read();
- while (data != -1) {
- char current = (char) data;
- result +=current;
- data = reader.read();
- }
- return result;
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return null;
- }
- //myheropicsnnames();
- }
- }
- /*private class Downloading extends AsyncTask<String, Void, Bitmap>
- {
- @Override
- protected Bitmap doInBackground(String... strings) {
- HttpsURLConnection httpURLConnection = null;
- URL url1;
- Bitmap myimg = null;
- try {
- url1 = new URL(strings[0]);
- httpURLConnection = (HttpsURLConnection) url1.openConnection();
- InputStream in = httpURLConnection.getInputStream();
- InputStreamReader reader = new InputStreamReader(in);
- myimg = BitmapFactory.decodeStream(in);
- return myimg;
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
- }*/
- /*public void randomno()
- {
- Random random= new Random();
- t=random.nextInt(100)+1;
- x=random.nextInt(4)+1;
- }
- public void myheropicsnnames()
- {
- Pattern p= Pattern.compile("src="(.*?)"");
- Matcher m=p.matcher(result);
- while (m.find())
- {
- heroimagelink=m.group(i);
- }
- Pattern k= Pattern.compile("alt="(.*?)">");
- Matcher l=k.matcher(result);
- while (l.find())
- {
- rightheronames=l.group(i);
- }
- randomno();
- while (l.find())
- {
- option1=l.group(t);
- }
- randomno();
- while (l.find())
- {
- option2=l.group(t);
- }
- randomno();
- while (l.find())
- {
- option3=l.group(t);
- }
- i++;
- }
- public void buttonclick(View view)
- {
- userchoice=options.getText().toString();
- if (userchoice==rightheronames)
- {
- toast="Fucking Awesome";
- }
- else
- {
- toast="STFU! The right answer is"+rightheronames;
- }
- Toast.makeText(this,toast,Toast.LENGTH_LONG).show();
- }
- public void gotfucked()
- {
- myimage= findViewById(R.id.imageView);
- myimage.setImageBitmap(heroimg);
- toption1=findViewById(R.id.textView);
- toption2=findViewById(R.id.textView2);
- toption3=findViewById(R.id.textView3);
- toption4=findViewById(R.id.textView4);
- if(x==1)
- {
- toption1.setText(rightheronames);
- toption2.setText(option1);
- toption3.setText(option2);
- toption4.setText(option3);
- }
- else if(x==2)
- {
- toption1.setText(option1);
- toption2.setText(rightheronames);
- toption3.setText(option2);
- toption4.setText(option3);
- }else if(x==3)
- {
- toption1.setText(option2);
- toption2.setText(option1);
- toption3.setText(rightheronames);
- toption4.setText(option3);
- }else
- {
- toption1.setText(option2);
- toption2.setText(option1);
- toption3.setText(option3);
- toption4.setText(rightheronames);
- }
- }*/
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Downloadbackground task = new Downloadbackground();
- try {
- result = task.execute("http://www.posh24.se/kandisar").get();
- Log.i("Code", result);
- //Log.i("Links", heroimagelink);
- //Log.i("Names", rightheronames);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- /*Downloading task1 = new Downloading();
- try {
- heroimg = task1.execute("https://www.google.com").get();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- myheropicsnnames();
- gotfucked();*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement