Jump to content

BigCake

Member
  • Posts

    144
  • Joined

  • Last visited

Everything posted by BigCake

  1. When I first installed the RAM module, I had Windows 10 Home, it ran without any problem for a week, after that I clean installed to Windows 10 Pro, since then I have been facing this issue. The newer RAM module has the same part identity as the previously installed one.
  2. I have Acer E5 575G, recently it randomly completely shuts off without any warning on battery. To turn on, I would then press power-up button. About 2 weeks ago, I installed another 8 GB RAM module installed Windows 10 pro after. I have run memory diagnostics, checked any disk errors, but everything is fine. One thing I have noticed is that when I boot it up again, I hear a one-time 'click' noise from the laptop. It's my work laptop, please someone suggest me a solution.
  3. I am thinking of buying a used external hard drive for storing my coding project backups. Why used? Because it is cheaper and currently I do not want to spend too much on a backup system. If it is 'worth' it to buy a hard drive what procedures should I take to inspect that it is still in use able condition. Thank you!
  4. I am trying to disable my DVD ROM so that it does not pops up when I press its button. Tried to disable its driver but it still works and the only the change I see is that 'CD/DVD' partition gets removed. Anyway to fix it?
  5. I am trying to create an application that would store 'to do works' and show it to the user. I have used SQLiteDatabase. The problem is that, I have setup cardview that would display the data user has entered. How it is displaying? It is supposed to read the data from sqlite database and then display to the card view. I am have been busting my a** off trying to find the solution but I could not. WorkListAdapter.kt package com.minutecodes.worklist.Data import android.content.Context import android.support.v7.widget.RecyclerView import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.TextView import com.minutecodes.worklist.CommonLibs.Work import com.minutecodes.worklist.R class WorkListAdapter(private val workList: ArrayList<Work>, private val context: Context): RecyclerView.Adapter<WorkListAdapter.ViewHolder>() { override fun onCreateViewHolder(parent: ViewGroup, position: Int): ViewHolder { var view = LayoutInflater.from(context).inflate(R.layout.work_list, parent, false) return ViewHolder(view) } override fun getItemCount(): Int { return workList.size } override fun onBindViewHolder(parent: ViewHolder, position: Int) { parent.bindItems(workList[position]) } class ViewHolder(itemView: View): RecyclerView.ViewHolder(itemView) { var workName = itemView.findViewById(R.id.listWorkNameID) as TextView var assignedTo = itemView.findViewById(R.id.listAssignedToID) as TextView var assignedBy = itemView.findViewById(R.id.listAssignedByID) as TextView var assignedDate = itemView.findViewById(R.id.listDateAssignedID) as TextView fun bindItems(work: Work) { workName.text = work.workName assignedTo.text = work.assignedTo assignedBy.text = work.assignedBy assignedDate.text = work.dateAssigned.toString() } } } DatabaseHandler.kt package com.minutecodes.worklist.Data import android.content.ContentValues import android.content.Context import android.database.Cursor import android.database.sqlite.SQLiteDatabase import android.database.sqlite.SQLiteOpenHelper import android.util.Log import com.minutecodes.worklist.CommonLibs.* import java.text.DateFormat import java.util.* import kotlin.collections.ArrayList class DataBaseHandler(context: Context): SQLiteOpenHelper(context, DATABASE_NAME, null, DATABASE_VERSION) { override fun onCreate(db: SQLiteDatabase?) { var DB_TABLE = "CREATE TABLE " +TABLE_NAME+ "(" +KEY_ID+ " INTEGER PRIMARY KEY," + KEY_WORK_NAME + " TEXT," + KEY_ASSIGNED_TO + " TEXT," + KEY_ASSIGNED_BY + " TEXT," + KEY_DATE_ASSIGNED + " LONG" + ")" db?.execSQL(DB_TABLE) } override fun onUpgrade(db: SQLiteDatabase?, p1: Int, p2: Int) { db?.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME) onCreate(db) } //Implementing CRUD functions fun createWork(work: Work) { var db: SQLiteDatabase = writableDatabase var values = ContentValues() //hashmap type values.put(TABLE_NAME, work.workName) values.put(KEY_ASSIGNED_TO, work.assignedTo) values.put(KEY_ASSIGNED_BY, work.assignedBy) values.put(KEY_DATE_ASSIGNED, work.dateAssigned) db.insert(TABLE_NAME, null, values) Log.d("DATA INSERTION", "SUCCESS") db.close() } fun readAWork(id: Int): Work { var db: SQLiteDatabase = writableDatabase val cursor = db.query(TABLE_NAME, arrayOf(KEY_ID, KEY_WORK_NAME, KEY_ASSIGNED_TO, KEY_ASSIGNED_BY, KEY_DATE_ASSIGNED), KEY_ID + "=?", arrayOf(id.toString()), null, null, null, null) if (cursor != null) cursor.moveToFirst() var work = Work() work.workName = cursor.getString(cursor.getColumnIndex(KEY_WORK_NAME)) work.assignedTo = cursor.getString(cursor.getColumnIndex(KEY_ASSIGNED_TO)) work.assignedBy = cursor.getString(cursor.getColumnIndex(KEY_ASSIGNED_BY)) work.dateAssigned = cursor.getLong(cursor.getColumnIndex(KEY_DATE_ASSIGNED)) var dateFormat: java.text.DateFormat = DateFormat.getDateInstance() var formatDate = dateFormat.format(Date(cursor.getLong(cursor.getColumnIndex(KEY_DATE_ASSIGNED))).time) return work } fun readBulkWorks(): ArrayList<Work> { var db: SQLiteDatabase = readableDatabase var list: ArrayList<Work> = ArrayList() var selectAll = "SELECT * FROM " + TABLE_NAME var cursor: Cursor = db.rawQuery(selectAll, null) if (cursor.moveToFirst()) { do { var work = Work() work.workID = cursor.getInt(cursor.getColumnIndex(KEY_ID)) work.assignedTo = cursor.getString(cursor.getColumnIndex(KEY_ASSIGNED_TO)) work.assignedBy = cursor.getString(cursor.getColumnIndex(KEY_ASSIGNED_BY)) work.dateAssigned = cursor.getLong(cursor.getColumnIndex(KEY_DATE_ASSIGNED)) list.add(work) } while (cursor.moveToNext()) } return list } fun updateWork(work: Work): Int { var db: SQLiteDatabase = writableDatabase var values = ContentValues() values.put(KEY_WORK_NAME, work.workName) values.put(KEY_ASSIGNED_TO, work.assignedTo) values.put(KEY_ASSIGNED_BY, work.assignedBy) values.put(KEY_DATE_ASSIGNED, System.currentTimeMillis()) return db.update(TABLE_NAME, values, KEY_ID + "=?", arrayOf(work.workID.toString())) } fun deleteWork(work: Work) { var db: SQLiteDatabase = writableDatabase db.delete(TABLE_NAME, KEY_ID + "=?", arrayOf(work.workID.toString())) db.close() } fun workCount(): Int { var db: SQLiteDatabase = writableDatabase var countQuery = "SELECT * TABLE " + TABLE_NAME var cursor: Cursor = db.rawQuery(countQuery, null) return cursor.count } } WorkActivity.kt package com.minutecodes.worklist.UI import android.support.v7.app.AppCompatActivity import android.os.Bundle import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.RecyclerView import com.minutecodes.worklist.CommonLibs.Work import com.minutecodes.worklist.Data.DataBaseHandler import com.minutecodes.worklist.Data.WorkListAdapter import com.minutecodes.worklist.R import kotlinx.android.synthetic.main.activity_work.* class WorkActivity : AppCompatActivity() { private var dbHandler: DataBaseHandler? = null private var adapter: WorkListAdapter? = null private var layoutManager: RecyclerView.LayoutManager? = null private var workList: ArrayList<Work>? = null private var workListItems: ArrayList<Work>? = null //for storing bulk works list override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_work) //Initializing variables dbHandler = DataBaseHandler(this) layoutManager = LinearLayoutManager(this) workList = ArrayList<Work>() workListItems = ArrayList<Work>() adapter = WorkListAdapter(workListItems!!, this) recyclerViewID.adapter = adapter recyclerViewID.layoutManager = layoutManager workList = dbHandler!!.readBulkWorks() for(workReader in workList!!.iterator()) { var work = Work() work.workName = workReader.workName work.assignedTo = workReader.assignedTo work.assignedBy = workReader.assignedBy work.dateAssigned = workReader.dateAssigned work.workID = workReader.workID workListItems!!.add(work) } adapter!!.notifyDataSetChanged() } } Main activity: package com.minutecodes.worklist.Activity import android.content.Intent import android.support.v7.app.AppCompatActivity import android.os.Bundle import android.text.TextUtils import android.widget.Toast import com.minutecodes.worklist.CommonLibs.Work import com.minutecodes.worklist.Data.DataBaseHandler import com.minutecodes.worklist.R import com.minutecodes.worklist.UI.WorkActivity import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { private var dbHandler: DataBaseHandler? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) setTitle("Add work") dbHandler = DataBaseHandler(this) saveWorkButtonID.setOnClickListener { if(TextUtils.isEmpty(workNameTxtID.text.toString()) || TextUtils.isEmpty(assignedToTxtID.text.toString()) || TextUtils.isEmpty(assignedByTxtID.text.toString())) { Toast.makeText(this, "Enter details", Toast.LENGTH_SHORT).show() } else { var work = Work() work.workName = workNameTxtID.text.toString() work.assignedTo = assignedToTxtID.text.toString() work.assignedBy = assignedByTxtID.text.toString() saveToDB(work) startActivity(Intent(this, WorkActivity::class.java)) } }//end of save button } fun saveToDB(work: Work) { dbHandler!!.createWork(work) } }
  6. Please anyone know how to fix it? I need to roll out update for my app real quickly for a bug fix. But this is error is giving warning that it may lead to run time crashes.
  7. I just tried to integrate Admob in my app. Here are the steps I did: 1- Add maven repository in project level Gradle 2- Added in my build.gradle file implementation 'com.google.android.gms:play-services-ads:15.0.1' Right after adding, com.support.android appcomapt threw error saying that libraries must use the exact same version specification implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' ^^ this one is causing the problem. I tried changing it to aplha1 and syncing the project but still no luck. The problem seems to be generating from maven repository Here is the probable source of problem : maven{url "https://maven.google.com"}
  8. I hate to debate on which language is the best to start with. What I believe is that if you are really determined you can start with almost any language. Remember if you start with a 'tough' language, it WILL take time to learn. It WILL make you angry sometimes. It WILL make you rethink you decision. But if you stay to your decision and give you 100%, you will learn it eventually and transitioning to other languages will be way(x100) easier. You like Android? Dont directly jump to learn it. If you want to eventually learn Android, start with Java. After you are done with Java, learn Kotlin and THEN learn Android.
  9. I tried registering dev account with my mastercard. They declined the card and I can not make in app purchases as well. Card does works, for test purpose I added 5$ to my steam account. What do I do?
  10. Hey there! First of all, lets throw that 'fast' out of the window. Talking about C++, you can find complete C++ tutorial on Youtube. Here is what you made mistake, dont watch tutorial in one go. Just no. Learning few things, say, conditions in C++. Then STOP the tutorial, open up compiler, start making your OWN test programs using conditions in as many different ways as you can think of. Remember this, no one can or will be a good programmer if you dont tackle the problems on your own first. Cant find solution after your brain storming? Simply Google it or ask for help.
  11. Acer E5 575G. Really feasible laptop for programming. i5 7200u 2GB 940MX 1TB HDD 16GB RAM
  12. Installed JDK manually. Installed with exe installer. There is only one problem now, it fails to load appcompat with unkown error. Basically almost every theme is 'dead'. It doesnt works unless I choose holo light theme.
  13. Since about 4 years, I have been living in a cave so I am pretty much completely 'new' to tech again. Basically, I want a monitor that is not too big and not too small, maybe 24inch? I do not know... I am not interested in gaming as much as I was before so I just want a monitor that displays vivid picture, has good viewing angles and must be under $100. I will be connecting the monitor with my laptop. Mostly, I will be shifting my programming tabs to the monitor and doing small tasks on my laptop. I guess you get the idea. I prefer Acer, Dell or HP displays because other than these company, I wont be able to find it here. Much thanks!
  14. BigCake

    Hey! Whats up with the profile picture? I reall…

    Princess Cadence 'Princess' suggests that the pony is female. But you said "his" to this female pony. I am confused. Final question, do you identify yourself as a brony?
  15. BigCake

    Hey! Whats up with the profile picture? I reall…

    Do you keep pony plush?
  16. Hey!

     

    Whats up with the profile picture? I really want to know :)

    1.   Show previous replies  9 more
    2. Crunchy Dragon
    3. Rainbow Dash

      Rainbow Dash

      @Crunchy Dragon Lol, every pony is best pony.

    4. Rainbow Dash

      Rainbow Dash

      @Princess Cadence The Equestria Girls series isn't too bad. I like pretty much both series. But what really was nice was the fact that they used the movie to bridge the Season 7 and 8. :)

  17. I think Macrium Reflect would be a better option
  18. Just with any object orientated language. Learning C++ or Java would give you a nice 'head start' when learning any other language(solely speaking from personal experience). Obviously it is relatively to python, it is pretty much 'difficult' for the first time. I suggest you C++ learning site that I used for over a year to learn. learncpp If you go the 'easy' way, sure go for Python. Its a great great language as well. But if you want the 'hard' way, C++ or Java will do the job
  19. Yes, MainActivity is already set as starting point
  20. PROBLEM 1: Basically, picture says it all. Any time I create a new 'empty activity' project, this error shows up. I am totally new to Android development and before I continue to expand my knowledge, I need to fix this error. Here is what I have tried: - Change API to 21, clean project - Rebuild project and manually referesh - Tried creating new projects with same activity I am using latest Android studio with latest plugins. PROBLEM 2: I dont want to just address this issue. I have setup virtual Android of API level 21 cloning Google Pixel(5.0 inch). Everything works fine with the emulator until I exit it. Upon exiting the emulator, my PC just straight up freezes, automatically starts switching apps, closes any irrelevant apps. The whole process takes about 2-3 minutes before emulator releases memory, only then PC becomes use able. I am suspecting RAM capacity to be the issue creator here. I have currently 8 GB RAM installed, upon running emulator, I am left with about 1.3 GB of use able RAM. Maybe its happening because of RAM? Though I will be upgrading to 16GB for 'future proofing' as well. Really need your help here guys. PROBLEM 3: I cant add textView or anything else on my app in 'design' tab. It just doesnt seem to add anything on it. Whats the problem? how can I fix it?
  21. My epic account: SmackDatChicken I am tier 23, not really much of a good player but I can be your side chicken.
×